Programming with Reflection

image\rwnprg32.gif WaitForEvent method

 

Syntax Found = object.WaitForEvent(EventType, Timeout, [String], [Row], [Column], [Key], [Options])

 

Description

Begins a wait that is satisfied by the occurrence of the specified event. The procedure containing the command is paused until the wait expires or is satisfied. Use the Options argument to allow keystrokes during the wait.

Arguments

EventType Argument type: Enumeration
Required
The event to wait for. The values are:

 rcSilence

 Defines an event as the absence of activity for the specified duration. By default inactivity means the absence of data from the host. You can set InactivityEventsIgnoreKeyboardMouse to False if you want keystrokes and mouse actions to restart the countdown.

 Use the String argument to specify an interval of time in HH:MM:SS.hh format.

 rcKbdEnabled

 Defines an event as the keyboard being unlocked for the specified duration. Use the String argument to specify an interval of time in HH:MM:SS.hh format.

 rcEvConnected

 Defines an event as a host connection being established. No additional arguments are needed for this event type.

 rcEvDisconnected

 Defines an event as a host connection becoming disconnected. No additional arguments are needed for this event type.

 rcEnterPos

 Defines an event as the positioning of the cursor at the specified screen coordinates, specified by the Row and Column arguments. For the event to occur, the cursor must be at the specified coordinates. To specify any row or column, use the value rcAnyRow or rcAnyCol, but not both at the same time.

 rcExitPos

 Defines an event as the positioning of the cursor at any location on the screen other than specified coordinates. Use the Row and Column arguments to specify coordinates. For the event to occur, the cursor must have previously been at the coordinates, and now must not be at the specified coordinates. To specify any row or column, use the value rcAnyRow or rcAnyCol, but not both at the same time.

 rcCommString

 Defines an event as the reception of the specified string from the host. Use the String argument to specify the string.

 rcDisplayString

 Defines an event as the specified string appearing at the specified row and column coordinates in the terminal window. Use the String argument to specify the string. Use Row and Column to specify coordinates. To specify any row or column, use rcAnyRow and/or rcAnyCol for Row and Column.

 rcTimeOfDay

 Defines an event as the current time matching the specified clock time. Use the String argument to specify the time of day in HH:MM:SS.hh format using a 24-hour clock (00:00:00-23:59:59).

 rcTime

 Defines an event as the passage of the specified amount of time from when the event is defined. Use the String argument to specify the interval of time in HH:MM:SS.hh format.

 rcBlockModeEnter

 The terminal has entered block mode. No additional arguments are needed for this event type.

 rcBlockModeExit

 The terminal has exited block mode. No additional arguments are needed for this event type.

 rcFileTransferDone

 A file transfer has successfully completed. No additional arguments are needed for this event type.

 rcTerminalKeystroke

 Defines an event as the transmission of the specified terminal key to the host. The Key argument defines the host function. The Key argument defines the host function. Note: Use the Options argument to allow keystrokes during the wait.

TimeOut Argument type: String
Required
Specifies an interval of time in HH:MM:SS.hh format. The wait terminates if this amount of time passes without the specified event occurring. If this method times out, an error is returned—use of an error handler is recommended.

String Argument type: String
Optional
Specifies the string that defines string-oriented events. Use this argument when the value you use for EventType requires a string—that is, when EventType is rcSilence, rcKbdEnabled, rcCommString, rcDisplayString, rcTimeOfDay, or rcTime.

Row Argument type: Integer or Enumeration
Optional
Specifies the row location for screen events. Use a row number to specify a particular row, or use rcAnyRow to specify that the event can occur at any row location. Use this argument when EventType is rcEnterPos, rcExitPos, or rcDisplayString.

Column Argument type: Integer or Enumeration
Optional
Specifies the column location for screen events. Use a column number to specify a particular column, or use rcAnyCol to specify that the event can occur at any column location. This argument is relevant when EventType is rcEnterPos, rcExitPos, or rcDisplayString.

Key Argument Type: Enumeration
Optional
Specifies a terminal key constant when EventType is rcTerminalKeystroke. For a complete list of terminal key constants, open the Reflection Type library in the object browser and look under TerminalKeys. To determine the appropriate constant for a particular keystroke, use the Reflection Keyboard Setup dialog box. When you click a key on the terminal keyboard, you'll see an identifier, such as VtF8 or HPF2, at the bottom of the dialog box. The terminal key constant is this identifier preceded by "rc" and followed by "Key," so the terminal key constant for VtF8 is rcVtF8Key.

Options Argument Type: Enumeration
Optional
Specifies additional, non-default behavior for the method. There is one option for this method:

 rcAllowKeystrokes

 Specifies that the user is allowed to enter keystrokes in the terminal window during the wait.

Return

Found Return type: Boolean
True if the specified event was satisfied, or False if the event was not satisfied before the method timed out. If no Timeout is specified, this method cannot return False.

 

 

image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command