Sign in to follow this  
Followers 0
zasxes

How do I get script to keep running instead of waiting for a Func to complete?

4 posts in this topic

How do I get the while look to continue to loop and not wait for the Test func to complete. Can the Test() func be called while it is already running?

$Test = 0

While 1
$Test = $Test+1
Sleep (3000)
Test($Test)
WEnd
Exit


Func Test($1)
IniWrite("C:\Temp\mytest.ini", "section2", @HOUR & ":" & @MIN & ":" & @SEC, "Event Start = " & $1)
Sleep (5000)
IniWrite("C:\Temp\mytest.ini", "section2", @HOUR & ":" & @MIN & ":" & @SEC, "Event End = " & $1)
EndFunc

Share this post


Link to post
Share on other sites



I think what you have would work, except it seems rather pointless... This will just keep on overlapping itself until their are tons of function Test() waiting to to the second part of the IniWrite().


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

How do I get the while look to continue to loop and not wait for the Test func to complete. Can the Test() func be called while it is already running?

$Test = 0

While 1
$Test = $Test+1
Sleep (3000)
Test($Test)
WEnd
Exit
Func Test($1)
IniWrite("C:\Temp\mytest.ini", "section2", @HOUR & ":" & @MIN & ":" & @SEC, "Event Start = " & $1)
Sleep (5000)
IniWrite("C:\Temp\mytest.ini", "section2", @HOUR & ":" & @MIN & ":" & @SEC, "Event End = " & $1)
EndFunc
You can not multi thread so you can't do 2 things at exactly the same time, there are various methods fro trying to fake multi threading using methods from posting gui messages to tcp/ip to text files to communicate between the 2 scripts.

Search for +multi +threading

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0