Host Event Expression Editor

To open this dialog box, click the Edit button when the WaitForMultipleEvents command is selected in the Operation Edit dialog box.

The events described here are used to synchronize the Host Integrator server with the state of the host application. These host synchronization events should be distinguished from event handlers, which perform or extend actions in the model file itself.

Use the Host Event Expression Editor dialog box to string together several events into one WaitForMultipleEvents command using the following event operand buttons:

Button Description
And Use And to conjoin two events to create a conditional event that is not satisfied until both events have occurred.
Or Use Or to conjoin two events to create a conditional event that is not satisfied until at least one of the two events has occurred.
Then Use Then to conjoin two events or expressions to create a conditional expression that is not satisfied until both events have occurred in order from left to right.
; Use ; to separate one statement from the next. Statements are evaluated sequentially.
( ) Use ( ) to group or combine events.

For example, if the following three global events are listed as follows:

Events Descriptions
EventA WaitForCommString "\033EnterData"
EventB WaitForCursorEnterPosition 5, 10
EventC WaitForCursorExitPosition 24, 2

You could then select one or more of the above events to formulate the following WaitForMultipleEvents command using the event operand buttons And, Or, Then, ;, and ():

WaitForMultipleEvents "EventA and (EventB or EventC)","30"

This means that Host Integrator will wait for EventA, and either EventB or EventC. If this series of events is not satisfied within the 30 second timeout period, an error will occur. It does not matter whether these events occur in a single host packet or across any number of multiple packets. These events may be received in any order.

Host events are processed in the order in which they are received from the host. Neither And nor Or can change this order. If the order of events is critical, use the Then operator.

The Then operator will not change the order of events received from the host, but it will ignore events or expressions on the right before events or expressions on the left are satified. For example:

EventA Then EventB

In the above example, the host could send events that might satisfy EventB, but those events will be ignored until EventA is satisfied. To further illustrate: EventA Then EventA Then EventA will be satisfied on the third occurance of EventA.

And, Or, and Then expressions may be combined in any arbitrary order in a statement, for example:

(EventA Then EventB) And (EventC Or EventD) Then (EventE Then EventF Then EventG)

This is a valid statement.

The semicolon can be used to separate statements, as in Java and C++. Statements will be considered separately and sequentially. By separating statements, a statement separator may behave somewhat like the Then operator. However, the Then operator can be used within statements and combined with the other operators, And and Or.

Other options :

Validate—Click to perform syntax checking of the expression.

Event Edit—Click to close this dialog box and open the Host Event Edit dialog box.

Related Topics
Bullet Adding an operation
Bullet Creating command lists