|
|
|
NOTE: This Design document is subject to change at any time. |
Thread
Syntax: <THREAD property-list>Script</THREAD>
Allows you to define a background thread that executes a script.
Keep in mind that Microsoft scripting engines can only exist in a single thread. Thus, you cannot access any variables, procedures, or functions that you might have defined in your main script. However, any zApp objects, including <VAR> can be accessed from the other thread, and all of the zApp function libraries are available in the thread.
Be sure to keep your thread code short and fast to avoid slowing down your application.
A thread can contain a script the executes at a given Interval, and you can set the number of times the thread is executed.
Here is an example of a thread the displays a background counter onto the status bar of the application:
Code: |
<THREAD name='MainThread' interval='1000' count='5' enabled='true'>
<SCRIPT event='OnInit'>
dim a
a = 0
</SCRIPT>
<SCRIPT>
a = a + 1
Status.Text = "Thread " & a
</SCRIPT>
</THREAD>
|
|
|