@ms wrote:
... Within a button box, Stop() will just terminate execution of the button script.
right!
important to know:
it's not due to the non-modal window, it's due to the limited influence of stop() on the main script.
I just wondered why this script doesn't manage to stop the script before x=5 is executed ...
[in the real script there are additional buttons which will not stop the code]
x=1;
New Window( "Phoenix Viewer",
<<Type( "Modal Dialog" ),
Button Box ("OK", Print("OK");stop(); Print("stopped before"))
);
//stop();
x=5;
so, even for modal windows, one has to a dummy variable to transfer the info to the main script and stop there.
x=1;
stop_flag=0;
New Window( "Phoenix Viewer",
<<Type( "Modal Dialog" ),
Button Box ("OK", Print("OK");stop_flag++;stop(); Print("stopped before"))
);
if(stop_flag, stop());
x=5;