Jump to content

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


zasxes
 Share

Recommended Posts

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
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...