Class Documentation
Wait |
1.0 |
ID_WAIT |
Stable |
Command |
October 2003 |
Rocklyte Systems |
Rocklyte Systems (c) 2002-2003. All rights reserved. |
The wait class is used to temporarily halt object script processing. |
Description
The Wait class provides you with the ability to halt script processing
temporarily. It is most useful in situations where you need to wait for a
user response. For example, if you pop up a confirmation dialog box during
batch script execution, you will need to wait for the user to respond before
continuing on with the rest of the script. Failure to wait may cause multiple
dialog boxes to be raised and the script may end prematurely, causing problems
for the user.
The Wait class works by monitoring an object for activity while the task
goes to sleep. When that object responds in the way that you expect, or if
the object is destroyed earlier than expected, the task will wake up and
processing will continue as normal. The sleeping process occurs when a wait
object is activated or the ClosingTag action is used. A wait object cannot
be made static as this defeats the purpose of the class. If you need to
respond to an action during run-time operations, you should use the Action
class instead.
If a wait object is destroyed before the monitored object draws a response,
the sleep process will break and continue as if a response was gained.
An extra feature also allows you to use wait objects to sleep for limited
periods of time. By setting the Seconds field, a
wait object can put your process to sleep for the period of time that you
specify. This field is a floating point unit, so you can also wait for
fractions of a second if you need precise scheduling.
Here are some DML examples demonstrating usage of the Wait class:
<wait object="[window]" action="free"/>
<wait seconds="0.5"/>
Structure
The Wait object consists of the following public fields:
Action | Set this field to specify the action or method that you want to wait for. |
Custom | Set this field if you need to wait on a customised action. |
Object | Refers to the object that you are waiting on. |
Seconds | If you want to wait for a limited amount of time, set the Seconds field. |
Field: | Action |
Short: | Set this field to specify the action or method that you want to wait for. |
Type: | STRING |
Status: | Read/Set |
This field must be set to determine the action or method that will break
the sleeping state induced by a wait object. A list of valid action names
are provided in the Action List Manual.
|
|
Field: | Custom |
Short: | Set this field if you need to wait on a customised action. |
Type: | STRING |
Status: | Read/Set |
If you need to wait on a customised action, set this field with the name
of the custom action instead of setting the Action field.
|
|
Field: | Object |
Short: | Refers to the object that you are waiting on. |
Type: | OBJECTID |
Status: | Read/Set |
The object that you want to monitor for activity will need to be specified
in this field. You will also need to supply the name of the action that will
be monitored by setting the Action field.
|
|
Field: | Seconds |
Short: | If you want to wait for a limited amount of time, set the Seconds field. |
Type: | DOUBLE |
Status: | Read/Init |
The Seconds field allows you to use a wait object for short pauses. By
setting this field to a value of 60 for example, you can wait for a period of
one minute. Because this field is in floating point, you can also wait for
extremely small intervals (accurate to 1/1000000th of a second, subject to
CPU and system performance).
|
|