interrupting a repeat loop

Jacques Hausser jacques.hausser at unil.ch
Tue Dec 15 10:01:08 EST 2009


Hi Tim

it depends of the kind of loop you are using. Several possibilities For example in a card script:

local stoploop

command runTheLoop
   repeat forever
      if stoploop = "S" then exit repeat
      -- do what you want
      wait 10 milliseconds with message
   end repeat
end runTheLoop

on keyDown thekey
    put thekey into stoploop
end keydown

The "wait x milliseconds with message" is the important trick here.

Jacques

Le 15 déc. 2009 à 15:37, Tim Selander a écrit :

> Is there any way in RR to check for user input during a repeat loop? I'd like a loop to continue until the user types a certain key -- at which point the script would exit the handler.
> 
> Tim Selander
> Tokyo, Japan
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

******************************************
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel/fax: 	++ 41 22 366 19 40
mobile:	++ 41 79 757 05 24
E-Mail:	jacques.hausser at unil.ch
*******************************************




More information about the use-livecode mailing list