thepip3r
(Hey THIS is FUN)
2005-07-21 10:04 PM
Question on ending a loop based on a time constraint

is there a way to kill a loop on the chance that it's running indefinately based off of a time using @ticks???

Mart
(KiX Supporter)
2005-07-21 10:14 PM
Re: Question on ending a loop based on a time constraint

You could build in an index variable.

Code:

Do
$index = $index + 1
?$index
Until $index = 10
?"Index is 10, quitting."
sleep 3



@ticks will return a very large number as it returns the elapsed milliseconds since the system has been started.

Quote from the 4.50 manual.
Quote:


@Ticks - Returns the number of milliseconds that have elapsed since the system was started.





thepip3r
(Hey THIS is FUN)
2005-07-21 10:29 PM
Re: Question on ending a loop based on a time constraint

Thanx Mart. So in essence, your loop will only perform 10 iterations... I appreciate the example.

Bryce
(KiX Supporter)
2005-07-22 12:16 AM
Re: Question on ending a loop based on a time constraint

Quote:

is there a way to kill a loop on the chance that it's running indefinately based off of a time using @ticks???




if you really want to exit a loop based on number fo minutes vs number of loops.
need this flipctime()

Code:

$30min = flipctime(@DATE,@TIME) + 1800

While flipctime(@DATE,@TIME) < $30min
;your loop will now run for the next 30 minutes
Loop



Bryce