Escaping from Repeat loops

Jim Ault JimAultWins at yahoo.com
Thu Sep 13 13:59:49 EDT 2007


Why not add a little debug step and see if the value changes?
and if so, to what.. could be the test is flawed.
This should work since globals are owned by Rev, not the handler.

>    repeat xNumberOfTimes
>       global doCancelVariable
> 
>       -- My Code Here
> 
          put "doCancelVariable = " && doCancelVariable into msg
>       wait 1 tick with messages
>       if doCancelVariable = "true" then
>          exit to top
>       end if
>    end repeat


On 9/13/07 10:30 AM, "Derek Bump" <list at dreamscapesoftware.com> wrote:

> I'm coming into this thread a little late, but I have a question.  I
> have a repeat loop that looks something like this:
> 
>    repeat xNumberOfTimes
>       global doCancelVariable
> 
>       -- My Code Here
> 
>       wait 1 tick with messages
>       if doCancelVariable = "true" then
>          exit to top
>       end if
>    end repeat
> 
> Within a "Cancel" button is a script that, when pressed, put's "true"
> into the global variable "doCancelVariable".
> 
> Everything works as it should, except that after pressing the button,
> the currently running script does not see that the global variable has
> changed.  Is there some way to see the change from the currently running
> script?
>





More information about the use-livecode mailing list