Login  Register

Re: Is "debug" a reserved name?

Posted by Stein Rørvik on Mar 02, 2019; 12:59pm
URL: http://imagej.273.s1.nabble.com/Is-debug-a-reserved-name-tp5021851p5021869.html

Thanks for this documentation update;

calling the debugger from the macro language is potentially very useful as one can then start the debugger automatically when a certain condition is met; to inspect the symbol table and step forward from the given breakpoint.

I looked quickly at the source code to see if there were more functions missing from the documentation and found that this is not documented in functions.html
        restorePreviousTool

It is self-explanatory and works as expected.

I also see that these functions are declared as aliases of other functions:
        getResultsCount (same as nResults)
        putPixel (same as setPixel)
        write (same as print)
That could also be mentioned in functions.html

And there is one orphan function which does not seem to be implemented or used anywhere:
        invert

So trying to name a variable "invert" in a macro will also give an error message.
Perhaps it should be removed, as it currently has no purpose?

Stein

-----Original Message-----
From: ImageJ Interest Group <[hidden email]> On Behalf Of Wayne Rasband
Sent: 28. februar 2019 15:59
To: [hidden email]
Subject: Re: Is "debug" a reserved name?

> On Feb 28, 2019, at 7:24 AM, Stein Rørvik <[hidden email]> wrote:
>
> I am trying to write this in a macro:
>
> var debug = false;
> if (debug) setBatchMode(false); else setBatchMode(true);
>
> but receive the error message "statement cannot begin with = in line 1"
>
> So, is the word "debug" a reserved keyword?

“debug” is a built in function that calls the macro debugger. The arguments are "break” (the default), "run", "trace", "fast-trace" and "dump”.

> There is no mention of it in https://imagej.nih.gov/ij/developer/macro/functions.html

I added a description of this function to the master list at

    http://wsr.imagej.net/developer/macro/functions.html
   
> if yes, what is its intended use?
>
> Stein

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html