Reflection .NET API
Attachmate.Reflection.Emulation.OpenSystems Assembly / Attachmate.Reflection.Emulation.OpenSystems Namespace / IScreen Interface / OnEvent Method
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.
Identifies the event that will trigger the commands specified in the Commands argument.
Specifies what sort of command to attach to the event.
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 IBMEnterKey", "RunMacro ""MyMacro"", """"" This string can be up to 260 characters long.
Specifies whether Event is enabled or disabled
Specifies what happens after Event occurs
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.
Specifies the row location for screen events. This argument is relevant when Event is EnterField, ExitField, EnterPos, ExitPos, or DisplayString. When Event is DisplayString, you can use AnyRow to indicate that the event can occur at any row location.
Specifies the column location for screen events This argument is relevant when Event is EnterField, ExitField, EnterPos, ExitPos, or DisplayString. When Event is DisplayString, you can use AnyCol to indicate that the event can occur at any column location.


In This Topic
    OnEvent Method (IScreen)
    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 EvNumber As Integer, _
       ByVal Event As OnEventEventType, _
       ByVal CommandType As OnEventCommandType, _
       ByVal Commands As String, _
       ByVal Enable As OnEventEnable, _
       ByVal AfterEvent As OnEventAfterEvent, _
       ByVal String As String, _
       ByVal Row As Integer, _
       ByVal Column As Integer _
    ) 
    'Usage
     
    
    Dim instance As IScreen
    Dim EvNumber As Integer
    Dim Event As OnEventEventType
    Dim CommandType As OnEventCommandType
    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, CommandType, 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
    Identifies the event that will trigger the commands specified in the Commands argument.
    CommandType
    Specifies what sort of command to attach to the event.
    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 IBMEnterKey", "RunMacro ""MyMacro"", """"" This string can be up to 260 characters long.
    Enable
    Specifies whether Event is enabled or disabled
    AfterEvent
    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 EnterField, ExitField, EnterPos, ExitPos, or DisplayString. When Event is DisplayString, you can use AnyRow 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 EnterField, ExitField, EnterPos, ExitPos, or DisplayString. When Event is DisplayString, you can use AnyCol to indicate that the event can occur at any column location.
    See Also