Login  Register

Re: WaitForUser problem

Posted by Ben G on Nov 06, 2008; 1:32pm
URL: http://imagej.273.s1.nabble.com/WaitForUser-problem-tp3694321p3694328.html

You are probably right, but some aspects of this I don't understand.

1. Why wouldn't there be an error message?
2. I had deleted all calls to the function, only the function remained
3. Each separate macro ran fine with all the calls and function active
4. It only crashed when I put the two macros into one file.  At this
point, all the calls had been deleted.

I find the macro wrapper to be confusing, with no documentation on what
happens when you put a program inside a macro.

It turns oout that EXIT is an easier dubugging tool for me anyway.

Thanks for your help.

Ben Gravely
----------------------------------------------------


Johannes Schindelin (via Nabble) wrote:

> Hi,
>
> On Wed, 5 Nov 2008, Ben G wrote:
>
> > [...] When I install the macro and run it, macro a) works fine and
> macro
> > b) crashes with a nonsensical error message that expects a ")" in the
> > middle of a P=nSlice kind of statement.
> >
> > After spending a week fighting with this bug (and using the pgms
> > separately), I tried again and found the bug. For trouble shooting
> my code,
> > I wrote a simply Pause function shown below.
> >
> > function P(){waitForUser("Press any key to continue");}
> >
> > located inside the end of each macro.
>
> Just a guess: you try to assign to the variable "P" after defining a
> function of the same name?
>
> I think that is a bug in your macro.  Never use the same name for a
> function _and_ for a variable.
>
> Hth,
> Dscho
>
>
> ------------------------------------------------------------------------
> This email is a reply to your post @
> http://n2.nabble.com/WaitForUser-problem-tp1461344p1464114.html
> You can reply by email or by visting the link above.
>