Studio:AutoScript Events: Difference between revisions
Jump to navigation
Jump to search
m (moved AutoScript Events to Studio:AutoScript Events) |
No edit summary |
||
Line 65: | Line 65: | ||
[[Category: AutoScript]] | [[Category:Studio:AutoScript]] |
Latest revision as of 16:09, 21 August 2009
WaitForEvent
Syntax
ascript.WaitForEvent()
Return Value
The return value is an object popped off of the front of this script's event queue. The returned object can be any of the following types. Each returned type exposes both Type and Name properties so that a script can identify the object and take appropriate action.
Object |
Type |
Name |
Function.Owner Object | "FunctionOwner" | Function Name |
Function.User Object | "FunctionUser" | Function Name |
Message.Owner Object | "BroadcastMessageOwner" "OneWayMessageOwner" "OneWayResponseOwner" "TwoWayMessageOwner" |
Message Name |
Message.User Object | "BroadcastMessageOwner" "OneWayMessageOwner" "OneWayResponseOwner" "TwoWayMessageOwner" |
Message Name |
Timer Object | "Timer" | Timer Name |
Error Object (see Remarks) |
"Error" | "Host Error" "Target Error" "System Error" |
Remarks
- WaitForEvent() is used to provide synchronization between a script and the STRIDE Runtime when asynchronous calls are made. The synchronization is accomplished by creating a event queue for each ascript instance (typically each script has a single ascript instance). Events are pushed onto the back of the queue by the runtime, and they are popped off of the front of the queue using WaitForEvent().
- WaitForEvent() will block script execution until an event is available in the queue.
- You can test whether one or more events are pending in the queue by checking the IsEventPending Property.
- An Error object is returned under the following circumstances:
|