Studio:AutoScript Events: Difference between revisions
Jump to navigation
Jump to search
(New page: == 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...) |
No edit summary |
||
Line 1: | Line 1: | ||
== Timeout Considerations == | |||
The following table describes the situations in which a timeout period applies or does not apply: | |||
{| cellspacing="0" cellpadding="10" width="100%" border="1" | |||
|- | |||
| width="250" bgcolor="#66ff99" | '''Action'''<br> | |||
| width="100" bgcolor="#66ff99" | '''Timeout Period Applies'''<br> | |||
|- | |||
| Script is run from within another script using [[ascript#ascript.Arguments|RunBlocking()]] from Studio. | |||
| Yes | |||
|- | |||
| Script is run by selecting the script in the Files Pane, right-clicking and choosing '''Run''' | |||
| Yes | |||
|- | |||
| Script is run from within a test suite by clicking [[Image:RunAll.png]] | |||
| Yes | |||
|- | |||
| Script is run from within an Editor window by clicking [[Image:Run.jpg]] | |||
| No | |||
|- | |||
| Script is run from within another script using [[ascript#ascript.Arguments|RunNonBlocking()]] from Studio. | |||
| No | |||
|} | |||
<br> | |||
== WaitForEvent == | == WaitForEvent == |
Revision as of 21:43, 11 July 2008
Timeout Considerations
The following table describes the situations in which a timeout period applies or does not apply:
Action |
Timeout Period Applies |
Script is run from within another script using RunBlocking() from Studio. | Yes |
Script is run by selecting the script in the Files Pane, right-clicking and choosing Run | Yes |
Script is run from within a test suite by clicking File:RunAll.png | Yes |
Script is run from within an Editor window by clicking | No |
Script is run from within another script using RunNonBlocking() from Studio. | No |
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:
|