Update a global when going to a stack as modal

Robert Brenstein rjb at rz.uni-potsdam.de
Fri Jan 9 06:52:24 EST 2004


>Frank,
>
>>  This doesn't work because LINE 3 gets executed right after
>>  LINE 2, not
>>  after the dialog is closed (i.e. Revolution doesn't wait for
>>  the modal
>>  dialog to be closed before it executes LINE 3).
>
>Actually, that's exactly what Rev does. When you call "modal <stack>",
>execution stops at that line until the modal dialog that was called is
>closed. I'm pretty sure "open <stack> as modal" does the same as "modal
><stack>", but if it *is* different, try "modal <stack>" instead (that's
>the one I'm used to).
>
>The approach you described of calling two separate handlers would be the
>way I would have done it in SuperCard; I'm glad Rev stops execution
>until you return from a modal dialog. :-)
>
>Ken Ray
>Sons of Thunder Software
>Email: kray at sonsothunder.com
>Web Site: http://www.sonsothunder.com/

Ken,

Modal command does NOT ALWAYS stop the execution. I have discovered 
this dual behavior way back with MetaCard 2.4.1 almost 2 years ago 
(see email from Scott below). I'd hoped this has been changed by now 
but apparently not. Fortunately, there is ways around this.

Robert Brenstein


>Date: Mon, 21 Jan 2002 11:34:53 -0700 (MST)
>From: Scott Raney <raney at metacard.com>
>To: Robert Brenstein <rjb at robelko.com>
>Subject: Re: modal stacks
>
>  > A propos modal, I have observed and verified that the modal command
>  > does not always suspend execution of the current script.
>  >
>  > If the modal command is used to open a substack, the execution of the
>  > current script is suspended until the modal stack is closed.
>  >
>  > If my script first goes invisibly to the substack (to fill in some
>  > fields), then do modal, the script finishes executing and the modal
>  > stack shows up afterwards.
>  >
>  > Is this the expected behavior?
>
>Possibly.  When you go to a stack, even if it's invisible, it's
>already opened, which will disrupt the behavior of "modal".  "open
>inv" is poor technique in MC anyway (it's only there as a SuperCard
>compatibility feature), as is setting up fields in one stack from
>another directly.  Instead, do the init in a preOpenStack handler, and
>get the data in the dialog from a well known place (use the dialogData
>property if you don't already have such a place).
>   Regards,
>     Scott


More information about the use-livecode mailing list