Hi All,
If there is an operation in your script which is executed 'forever' how do you stop it?
I've tried 'stop script' but this is ignored and 'stop all' and this stops EVERYTHING (obviously!).
Any answers - greatly appriciated,
G_O.
Offline
Hi Mick,
So if I wanted to repeat an operation 'continuosly' (or forever) but only for certain length of time, how would I set up my script?
Example -
When 'flag' clicked
wait 10 secs
Forever
Change Y by -5
Wait 0.5 secs
Change Y by 5
Wait 0.5
How would I be able to perform the above 'forever' section of the script for only a certain lengh of time?
Cheers,
G_O.
Offline
Ginger,
Stop Script should get you out of a forever loop. Are you sure it's ever getting to the Stop Script blocK?
Here's how I would repeat something for a particular amount of time, in this case five seconds (assume I've created a variable called StopTime):
set StopTime to Timer + 5
Repeat until Timer > StopTime
Change Y by -5
etc.
Offline
My advice is to use the forever block only very sparingly. There is a good reason why the repeat-until construct (and slight variants) is more common in programming languages!
Offline