deano Posted September 12, 2005 Share Posted September 12, 2005 Ok, How do i put a timelimit kinda thingy, To my function? As in, If my _sendabc() function took longer then 60 seconds, i would like it to exit the Do Loop, And call the _tooktolong() func, how can this be done? And i can't take out the do loop in _sendabc(), my script needs it. here is an example(this is not my actual script) Func _sendabc() local $int = 0 do send("abc") $int = 1 Until $int = 1 if not @error And $int = 1 Then return 1 Else return 0 Endif Endfunc Func _tooktolong() tooltip("_sendabc took longer then 60seconds.",0,0) return 1 Endfunc i've been trying to do it for hours, please help if you can. Link to comment Share on other sites More sharing options...
ning Posted September 12, 2005 Share Posted September 12, 2005 You need to use TimerInit() and TimerDiff(). Call TimerInit() before the start of your loop, and call TimerDiff() inside the loop to check the timeout has not occurred. If it has, exit the loop (either with ExitLoop or a condition in the Until statement). Link to comment Share on other sites More sharing options...
deano Posted September 12, 2005 Author Share Posted September 12, 2005 thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now