OnEvent Method (IIbmScreen)
In This Topic
Defines commands to be executed when a specified event occurs during a Reflection session. Events defined with this method are equivalent to those defined using the Event Setup dialog box. When you save your settings file, this event becomes part of that settings file and will appear in the list of events shown in the Event Setup dialog box. Events defined by OnEvent will execute after your macro completes.You cannot use this method to accomplish actions during macro execution.
Syntax
'Declaration
Sub OnEvent( _
ByVal As Integer, _
ByVal As OnEventEventType, _
ByVal Commands As String, _
ByVal As OnEventEnable, _
ByVal As OnEventAfterEvent, _
ByVal As String, _
ByVal As Integer, _
ByVal Column As Integer _
)
'Usage
Dim instance As IIbmScreen
Dim EvNumber As Integer
Dim Event As OnEventEventType
Dim Commands As String
Dim Enable As OnEventEnable
Dim AfterEvent As OnEventAfterEvent
Dim String As String
Dim Row As Integer
Dim Column As Integer
instance.OnEvent(EvNumber, Event, Commands, Enable, AfterEvent, String, Row, Column)
Parameters
- EvNumber
- An index number that determines the location of this event on the list of defined events. Use 1 to add a new event to the top of the list. Use 0 to add the event to the end of the list. The EventDefined property returns the number of the most recently defined event.
- Event
- An OnEventEventType enumeration value that identifies the event that will trigger the commands specified in the Commands argument.
- Commands
- The method, or sequence of methods, to be executed when the event specified by the Event argument occurs. Methods that return values can't be used. Use a space to separate multiple methods. Use double quotation marks around string arguments. For example, the following strings are all valid for this argument: "Connect", "TransmitAnsi ""Hello"" TransmitTerminalKey rcIBMEnterKey", "RunMacro ""MyMacro"", """"" This string can be up to 260 characters long.
- Enable
- An OnEventEnable enumeration value that specifies whether Event is enabled or disabled
- AfterEvent
- An OnEventAfterEvent enumeration value that specifies what happens after Event occurs
- String
- Specifies the string that defines string-oriented events. This argument is only relevant when the value you use for Event requires a string—, that is, when Event is LoadSettingsFile, CommString, DisplayString, TimeOfDay, or Time.
- Row
- Specifies the row location for screen events. This argument is relevant when Event is rcEnterField, rcExitField, rcEnterPos, rcExitPos, or rcDisplayString. When Event is rcDisplayString, you can use rcAnyRow to indicate that the event can occur at any row location.
- Column
- Specifies the column location for screen events This argument is relevant when Event is rcEnterField, rcExitField, rcEnterPos, rcExitPos, or rcDisplayString. When Event is rcDisplayString, you can use rcAnyCol to indicate that the event can occur at any column location.
See Also