Stop a repeat script

Damien Girard dam-pro.girard at laposte.net
Fri Jun 17 06:58:11 EDT 2005


Le jeudi 16 juin 2005 à 19:23 -0400, Thomas McCarthy a écrit :
> A good idea I picked up from somewhere is to build in a time limit on repeats whenever possible:
> 
> --before entering repeat loop
> put the ticks + 600 into endtime --(10 second timelimit)
> repeat with i = 1 to somenumber
> if the ticks > endtime then
> answer "overtime" --might want to report other information to help debug
> exit repeat
> end if
> 
> do repeat stuff here
> end repeat
> 
> it's only a couple of lines of code, but it's saved me many a crash.
> cheers
> tom
> 
I used already a similar method (but without the ticks command), but
this method is better than my method, I think I will use it.

Damien



More information about the use-livecode mailing list