lopolop Posted December 9, 2005 Share Posted December 9, 2005 i have a loop going that has a counter in it... when that reaches a certing amount then it runs a func(all in loop) does the script pause until the Function is complete? because the func takes a few seconds. also it would be easier then having a counter but wasn't sure if i could use 2 loops in a script like just so every 10 minutes it runs the function while the other loop is still going Link to comment Share on other sites More sharing options...
dabus Posted December 9, 2005 Share Posted December 9, 2005 Yes, the scripts waits till func is done, if you use it like this: While 1 Sleep (100) MySleep () WEnd Func MySleep () ConsoleWrite ("Start"&@CR) Sleep (1000 *5 ) ConsoleWrite ("Stop"&@CR) EndFunc What about using AdlibEnable() ??? You could replace loop with AdlibEnable ( "Task", 1000 ) to run Task once a second. Link to comment Share on other sites More sharing options...
seandisanti Posted December 9, 2005 Share Posted December 9, 2005 Yes, the scripts waits till func is done, if you use it like this: While 1 Sleep (100) MySleep () WEnd Func MySleep () ConsoleWrite ("Start"&@CR) Sleep (1000 *5 ) ConsoleWrite ("Stop"&@CR) EndFunc What about using AdlibEnable() ??? You could replace loop with AdlibEnable ( "Task", 1000 ) to run Task once a second.even with an adlib, the main thread of the script pauses during execution. If you really need the two threads to run concurrently, you should put the secondary function in a compile script of it's own, and call it as necessary with Run(), passing the function parameters as command line arguments. 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