Copyright: Copyright © 1996, Attachmate Corporation. All Rights Reserved.


OLE Automation Example 1

Sub Test1()
    Dim Sys As System
    Dim Sess As Session

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Loop through all sessions and minimize each one
    For Each Sess In Sys.Sessions
        Sess.WindowState = xMINIMIZED
    Next

    MsgBox "All sessions should now be minimized"
End Sub


OLE Automation Example 2

Sub Test2()
    Dim Sys As System
    Dim Sess As Session
    Dim Ws As Waits
    Dim UserWaitId, SystemWaitId, WelcomeWaitId As Long
    Dim ErrorWaitId, DiscWaitId, WaitId As Long
    Dim OldSynchronous As Boolean

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get or start a specific session
    Set Sess = GetObject("c:\keaterm\win\user\test.ktc")

    ' Create a Waits object
    Set Ws = Sys.Waits

    ' Set the Synchronous property to True so received host
    ' data is blocked while not in the Wait call. We save the
    ' old value so it can be restored below
    OldSynchronous = Sess.Screen.Synchronous
    Sess.Screen.Synchronous = True

    ' Create some wait-type objects and add them to the Waits
    ' collection, we save the returned identifiers for later use
    UserWaitId = Ws.Add(Sess.Screen.WaitForString("UserID:"))
    SystemWaitId = _
        Ws.Add(Sess.Screen.WaitForString("SystemID:"))
    WelcomeWaitId = Ws.Add(Sess.Screen.WaitForString("Welcome"))
    ErrorWaitId = _
        Ws.Add(Sess.Screen.WaitForString("Network Error"))
    DiscWaitId = Ws.Add(Sess.WaitForDisconnect())

    ' We disconnect and reconnect to force a login prompt
    Sess.Connected = False
    Sess.Connected = True

    ' Wait a maximum of 30 seconds for the first prompt
    WaitId = Ws.Wait(30000)

    ' Loop until a timeout occurs or we exit from inside
    ' the loop
    Do While WaitId <> 0
        ' Handle each event depending on which Wait object it
        ' came from
        If WaitId = UserWaitId Then
            ' Handle the UserID prompt by sending our username
            ' followed by a carriage return
            Sess.Screen.PutString "John Smith" + Chr(13)

            ' Remove this MatchWait so we do not continue to
            ' match on the string that is still on the screen
            Ws.Remove WaitId
        ElseIf WaitId = SystemWaitId Then
            ' Handle the SystemID prompt by sending our system
            ' name followed by a carriage return
            Sess.Screen.PutString "Our System" + Chr(13)

            ' Remove this MatchWait so we do not continue to
            ' match on the string that is still on the screen
            Ws.Remove WaitId
        ElseIf WaitId = WelcomeWaitId Then
            ' We are logged in!
            MsgBox "We are logged in!"
            Exit Do
        ElseIf WaitId = ErrorWaitId Then
            ' Handle the network error by displaying a message
            ' and dropping out of the loop
            MsgBox "A network error has occured!"
            Exit Do
        ElseIf WaitId = DiscWaitId Then
            ' Handle a disconnect by displaying a message and
            ' dropping out of the loop
            MsgBox "We have been disconnected!"
            Exit Do
        Else
            ' We should never get to this point
            MsgBox "Should never have gotten here!"
            Exit Do
        End If

        ' Wait a maximum of 10 seconds for any subsequent
        ' prompts
        WaitId = Ws.Wait(10000)
    Loop

    ' Return the Synchronous property to its previous value
    Sess.Screen.Synchronous = OldSynchronous
End Sub


OLE Automation Example 3

Sub Test3()
    Dim Sess As Session
    Dim W As CursorWait
    Dim R As Integer

    ' Get or start a specific session
    Set Sess = GetObject("c:\keaterm\win\user\test.ktc")

    ' Create an object to wait for the cursor to move
    Set W = Sess.Screen.WaitForCursorMove

    ' The following line performs an implicit wait if the
    ' cursor has not moved since we created the object above
    R = W.Row
End Sub


OLE Automation Example 4

Sub Test4()
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen

    ' Get or start a specific session
    Set Sess = GetObject("c:\keaterm\win\user\test.ktc")

    ' Get the Screen object for this session
    Set Scrn = Sess.Screen
End Sub


OLE Automation Example 7

Sub Test7()
    Dim Sess As Session
    Set Sess = GetObject(, "KEA!.Session")

    Dim Str As String
    Dim KW As KeyWait

    Set KW = Sess.Screen.WaitForKeys
    KW.Wait
    Str = KW.Name
End Sub


OLE Automation Example 8

Sub Test8()
    Dim Sys As System
    Dim Sess As Session
    Dim Str As String

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the name of the active session
    Str = Sess.Name

    MsgBox "The active session is: " + Str
End Sub


OLE Automation Example 9

Sub Test9()
    Dim Sys As System
    Dim Sessns As Sessions
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen
    Dim Ar As Area

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the Sessions object
    Set Sessns = Sys.Sessions

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    ' Create an Area object
    Set Ar = Scrn.Area(1, 1, 10, 10)

    ' All these return the same result
    MsgBox "System.Application = " + Sys.Application.Name
    MsgBox "Sessions.Application = " + Sessns.Application.Name
    MsgBox "Session.Application = " + Sess.Application.Name
    MsgBox "Screen.Application = " + Scrn.Application.Name
    MsgBox "Area.Application = " + Ar.Application.Name
End Sub


OLE Automation Example 10

Sub Test10()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen
    Dim Ar As Area

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    ' This illustrates the Top, Left, Bottom and Right
    ' properties for an Area object by setting the values to
    ' create an area that includes everything on the first page
    ' except the top and bottom rows and the leftmost and
    ' rightmost columns. The resulting area is then selected to
    ' make it visible to the user.
    Set Ar = Scrn.Area(2, 2, Scrn.Rows - 1, Scrn.Cols - 1, 1, _
        xBLOCK)
    Ar.Select
    MsgBox "The session should now have an area selected"

    ' This illustrates the Top, Left, Height and Width
    ' properties for a Session object by getting the values and
    ' setting them to 1/2 their original values. This will move
    ' the session window towards the top left corner of your
    ' screen and shrink it to half its original size. This
    ' sample assumes the session is not maximized.
    Sess.Top = Sess.Top / 2
    Sess.Left = Sess.Left / 2
    Sess.Height = Sess.Height / 2
    Sess.Width = Sess.Width / 2
    MsgBox "The session should now have been moved and resized"
End Sub


OLE Automation Example 11

Sub Test11()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    MsgBox "The cursor is at row " + Str(Scrn.Row) + _
        " column " + Str(Scrn.Col) + " on page " + _
        Str(Scrn.Page)
    MsgBox "The screen has " + Str(Scrn.Rows) + " rows and " + _
        Str(Scrn.Cols) + " columns"
End Sub


OLE Automation Example 12

Sub Test12()
    Dim Sys As System
    Dim Sess As Session
    Dim Connected As String

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    For Each Sess In Sys.Sessions
        If Sess.Connected Then
            Connected = Connected + Sess.Name + " "
        End If
    Next Sess

    MsgBox "The following sessions are connected: " + Connected
End Sub


OLE Automation Example 13

Sub Test13()
    Dim Sys As System
    Dim Sessns As Sessions
    Dim NumberOfSessions, i As Integer
    Dim Opened As String

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Use a temporary variable to hold the Sessions object
    ' since some languages do not handle Sys.Sessions(i)
    Set Sessns = Sys.Sessions

    ' Get the number of open sessions
    NumberOfSessions = Sessns.Count

    ' This example shows the implicit call to the Item method
    For i = 1 To NumberOfSessions
        Opened = Opened + Sessns.Item(i).Name + " "
    Next

    MsgBox "The following sessions are open: " + Opened

    ' Since the Item method is the default method for the
    ' Sessions object we can leave it out as the following
    ' example shows
    Opened = ""
    For i = 1 To NumberOfSessions
        Opened = Opened + Sessns(i).Name + " "
    Next

    MsgBox "Once again the following sessions are open: " + _
        Opened
End Sub


OLE Automation Example 14

Sub Test14()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    ' Demonstrate some of the properties of the System object
    MsgBox "System Version: " + Sys.Version
    MsgBox "System Name: " + Sys.Name
    MsgBox "System FullName: " + Sys.FullName

    ' Demonstrate some of the properties of the Session object
    MsgBox "Session FullName: " + Sess.FullName
    MsgBox "Session Path: " + Sess.Path

    ' Demonstrate some of the properties of the Screen object
    MsgBox "Screen HostName: " + Scrn.HostName
End Sub


OLE Automation Example 15

Sub Test15()
    Dim Sys As System
    Dim Sess As Session

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    If Sess.Saved Then
        MsgBox "Session has not been changed since it was " + _
        "last saved."
    Else
        MsgBox "Session HAS been changed since it was last " + _
        "saved."
    End If
End Sub


OLE Automation Example 16

Sub Test16()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen
    Dim i As Integer

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    ' This example moves a selected line from the top of the
    ' screen to the bottom. A key press is required for each
    ' step.
    For i = 1 To Scrn.Rows
        ' Select a row
        Scrn.Select i, 1, i, Scrn.Cols

        ' Wait for a key to be pressed
        Scrn.WaitForKeys
    Next
End Sub


OLE Automation Example 17

Sub Test17()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen
    Dim Ar As Area

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    ' This will return the coordinates of the area selected in
    ' the current session. Note, that if nothing is selected the
    ' area will be empty, i.e., its coordinates will all be -1.
    Set Ar = Scrn.Selection
    MsgBox "Selected area: " + Str(Ar.Left) + "," + _
        Str(Ar.Top) + "," + Str(Ar.Right) + "," + _
        Str(Ar.Bottom) + " on page " + Str(Ar.Page)

    ' Now display the type of area
    If Ar.Type = xNONE Then
        MsgBox "The Area type is xNONE"
    ElseIf Ar.Type = xPOINT Then
        MsgBox "The Area type is xPOINT"
    ElseIf Ar.Type = xSTREAM Then
        MsgBox "The Area type is xSTREAM"
    ElseIf Ar.Type = xBLOCK Then
        MsgBox "The Area type is xBLOCK"
    End If

    ' Now display the actual selected text
    MsgBox "The Area contains: " + Ar.Value
End Sub


OLE Automation Example 18

Sub Test18()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Make the active session invisible
    Sess.visible = False
    MsgBox "The session should now be invisible"

    ' Make the active session visible
    Sess.visible = True
    MsgBox "The session should now be visible"
End Sub


OLE Automation Example 19

Sub Test19()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Make the active session minimized
    Sess.WindowState = xMINIMIZED
    MsgBox "The session should now be minimized"

    ' Make the active session maximized
    Sess.WindowState = xMAXIMIZED
    MsgBox "The session should now be maximized"
End Sub


OLE Automation Example 20

Sub Test20()
    Dim Sys As System
    Dim Sess As Session
    Dim Ws As Waits
    Dim KW As KeyWait
    Dim WaitId As Integer

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Create a Waits object
    Set Ws = Sys.Waits

    ' Create a KeyWait object
    Set KW = Sess.Screen.WaitForKeys

    ' Add the KeyWait object to the Waits collection
    WaitId = Ws.Add(KW)

    ' Remove our reference to the KeyWait object
    Set KW = Nothing

    ' At this point keystrokes are still being queued because the
    ' KeyWait object exists in the Waits collection

    ' Either of the lines below will cause the keystrokes to be
    ' dequeued
    Ws.Remove WaitId
    ' or
    Set Ws = Nothing
End Sub


OLE Automation Example 21

Sub Test21()
    Dim Sys As System
    Dim Sess As Session
    Dim Ws As Waits
    Dim UserWaitId, SystemWaitId, WelcomeWaitId As Long
    Dim ErrorWaitId, DiscWaitId, WaitId As Long
    Dim OldSynchronous As Boolean
    Dim StartTime As Long

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get or start a specific session
    Set Sess = GetObject("c:\keaterm\win\user\test.ktc")

    ' Create a Waits object
    Set Ws = Sys.Waits

    ' Set the Synchronous property to True so received host
    ' data is blocked while not in the Changed property. We
    ' save the old value so it can be restored below
    OldSynchronous = Sess.Screen.Synchronous
    Sess.Screen.Synchronous = True

    ' Create some wait-type objects and add them to the Waits
    ' collection. We save the returned identifiers for later use
    UserWaitId = Ws.Add(Sess.Screen.WaitForString("UserID:"))
    SystemWaitId = _
        Ws.Add(Sess.Screen.WaitForString("SystemID:"))
    WelcomeWaitId = Ws.Add(Sess.Screen.WaitForString("Welcome"))
    ErrorWaitId = _
        Ws.Add(Sess.Screen.WaitForString("Network Error"))
    DiscWaitId = Ws.Add(Sess.WaitForDisconnect)

    ' We disconnect and reconnect to force a login prompt
    Sess.Connected = False
    Sess.Connected = True

    ' Save the current time using the Visual Basic Timer utility
    StartTime = Timer

    ' We allow up to 60 seconds for logging in
    Do While (Timer - StartTime) < 60
        ' Check the Changed property to see if any of the
        ' objects in the Waits collection have triggered an
        ' event
        WaitId = Ws.Changed
        If WaitId <> 0 Then
            ' Handle each event depending on which Wait object
            ' it came from
            If WaitId = UserWaitId Then
                ' Handle the UserID prompt by sending our
                ' username followed by a carriage return
                Sess.Screen.PutString "John Smith" + Chr(13)

                ' Remove this MatchWait so we do not continue to
                ' match on the string that is still on the
                ' screen
                Ws.Remove WaitId
            ElseIf WaitId = SystemWaitId Then
                ' Handle the SystemID prompt by sending our
                ' system name followed by a carriage return
                Sess.Screen.PutString "Our System" + Chr(13)

                ' Remove this MatchWait so we do not continue to
                ' match on the string that is still on the
                ' screen
                Ws.Remove WaitId
            ElseIf WaitId = WelcomeWaitId Then
                ' We are logged in!
                MsgBox "We are logged in!"
                Exit Do
            ElseIf WaitId = ErrorWaitId Then
                ' Handle the network error by displaying a
                ' message and dropping out of the loop
                MsgBox "A network error has occured!"
                Exit Do
            ElseIf WaitId = DiscWaitId Then
                ' Handle a disconnect by displaying a message
                ' and dropping out of the loop
                MsgBox "We have been disconnected!"
                Exit Do
            Else
                ' We should never get to this point
                MsgBox "Should never have gotten here!"
                Exit Do
            End If
        End If

        ' At this point in the loop we can do other processing
        ' for short periods before looping back up and checking
        ' Changed again
    Loop

    ' Return the Synchronous property to its previous value
    Sess.Screen.Synchronous = OldSynchronous
End Sub


OLE Automation Example 22

Sub Test22()
    Dim Sys As System
    Dim Sess As Session

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    For Each Sess In Sys.Sessions
        MsgBox "Activating session " + Sess.Name
        Sess.Activate

        MsgBox "Closing session " + Sess.Name
        Sess.Close
    Next Sess
End Sub


OLE Automation Example 23

Sub Test23()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen
    Dim Ar As Area

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    ' Create an area that includes everything on the first page
    ' except the top and bottom rows and the leftmost and
    ' rightmost columns. The resulting area is then selected to
    ' make it visible to the user.
    Set Ar = Scrn.Area(2, 2, Scrn.Rows - 1, Scrn.Cols - 1, 1, _
        xBLOCK)
    Ar.Select
    MsgBox "The session should now have an area selected"
End Sub


OLE Automation Example 24

Sub Test24()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen
    Dim Ar As Area

    ' Invoke the clipboard viewer
    Shell "clipbrd.exe"

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    ' Select the session screen and copy it to the clipboard.
    Scrn.SelectAll
    Scrn.Copy
    MsgBox "The session should now be displayed in the " + _
        "clipboard"

    ' Create an area that includes everything on the first page
    ' except the top and bottom rows and the leftmost and
    ' rightmost columns. The resulting area is then selected
    ' and copied to the clipboard.
    Set Ar = Scrn.Area(2, 2, Scrn.Rows - 1, Scrn.Cols - 1, 1, _
        xBLOCK)
    Ar.Select
    Ar.Copy
    MsgBox "An area of the session should now be displayed " + _
        "in the clipboard"
End Sub


OLE Automation Example 25

Sub Test25()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen
    Dim Str As String

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    ' Get the first 2 rows
    Str = Scrn.GetString(1, 1, 2 * Scrn.Cols)

    MsgBox "The first 2 rows are: " + Str
End Sub


OLE Automation Example 26

Sub Test26()
    Dim Sess As Session
    Dim Recv As Integer

    ' Get or start a specific session
    Set Sess = GetObject("c:\keaterm\win\user\test.ktc")

    ' Since we are not using the FileTransferWait object created
    ' by ReceiveFile below but are instead asking for the Result
    ' of the file transfer this line of code will not return
    ' until the file transfer has completed.

    ' What is happening here is that Visual Basic will return
    ' the default property for the FileTransferWait object
    ' (the FileEnd property) and assign this value to Recv.
    ' Since the value of FileEnd is not known until the file
    ' transfer is complete the assigning of Recv will not occur
    ' until that happens.

    Recv = Sess.ReceiveFile("*.txt", "c:\temp\test2.txt")
    If Recv = xFileEndFail Then
        MsgBox "At least one file failed"
    ElseIf Recv = xFileEndCancel Then
        MsgBox "At least one file cancelled"
    ElseIf Recv = xFileEndSkip Then
        MsgBox "At least one file skipped"
    ElseIf Recv = xFileEndRename Then
        MsgBox "At least one file renamed"
    ElseIf Recv = xFileEndOk Then
        MsgBox "All files transferred OK"
    Else
        MsgBox "Unknown file transfer result code!"
    End If
End Sub


OLE Automation Example 27

Sub Test27()
    Dim Sess As Session
    Dim Res As Integer

    ' Get or start a specific session
    Set Sess = GetObject("c:\keaterm\win\user\test.ktc")

    ' Since we are not using the MacroWait object created by
    ' RunMacro below but are instead asking for the Result of
    ' the macro this line of code will not return until the
    ' macro has completed.

    ' What is happening here is that Visual Basic will return
    ' the default property for the MacroWait object (the
    ' MacroEnd property) and assign this value to Res. Since the
    ' value of MacroEnd is not known until the macro is complete
    ' the assigning of Res will not occur until that happens.

    Res = Sess.RunMacro("diallong.ktm")
    If Res = xMacroFail Then
        MsgBox "Macro failed"
    ElseIf Res = xMacroCancel Then
        MsgBox "Macro cancelled"
    ElseIf Res = xMacroOk Then
        MsgBox "Macro OK"
    Else
        MsgBox "Unknown macro result code!"
    End If
End Sub


OLE Automation Example 28

Sub Test28()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen
    Dim Ar As Area

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    Set Ar = Scrn.Search("select this")
    Ar.Select
End Sub


OLE Automation Example 29

Sub Test29()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen
    Dim Ar As Area

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    ' This will put "Hello User!" at the upper left of
    ' the screen
    Scrn.SendInput Chr(27) + "[H" + "Hello User!"
End Sub


OLE Automation Example 30

Sub Test30()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    ' Send an F3 to the host to start the slideshow
    Scrn.SendKeys "<F3>"

    ' Since we are not using the returned CursorWait object the
    ' call will not return until the cursor has moved to the
    ' specified location
    Scrn.WaitForCursor 20, 16, 1

    ' We log into the slideshow program by sending our name. The
    ' Chr(13) is the carriage return sequence.
    Scrn.SendKeys "user1" + Chr(13)

    ' Wait for the cursor to move to the specified location.
    ' Since we have experienced very long delays here in the
    ' past we will only wait for 15 seconds. The Wait method of
    ' the returned CursorWait object is called with 15000
    ' milliseconds as the timeout.
    If Not Scrn.WaitForCursor(23, 1).Wait(15000) Then
        MsgBox "We waited for 15 seconds without matching " + _
            "on the cursor location!"
    End If

    ' Wait for the "Ready to continue?" prompt to appear in the
    ' input stream. We look for it there since it does not
    ' always appear in the same location on the screen.
    Scrn.WaitForStream "Ready to continue?"
    Scrn.SendKeys "Y" + Chr(13)

    ' Wait for the "All done" prompt to appear on the screen at
    ' the specified column. We know that it will always appear
    ' at this column when the slideshow is completed but it does
    ' not always appear on the same row so we set that parameter
    ' to 0.
    Scrn.WaitForString "All done", 0, 15

    ' Log off
    Scrn.SendKeys "logoff" + Chr(13)
End Sub


OLE Automation Example 31

Sub Test31()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen
    Dim Str As String

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    ' Since we are asigning the result to a String value Visual
    ' Basic will get the default property from the KeyWait
    ' object and assign it to Str. Since the default property of
    ' the KeyWait object is the name of the key it cannot be
    ' returned until a key has been seen. For this reason the
    ' call below will not return until a key is pressed.
    Str = Scrn.WaitForKeys
    MsgBox "WaitForKeys returned: " + Str
End Sub


OLE Automation Example 32

Sub Test32()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Screen to differentiate between
    ' the Visual Basic Screen object and the KEA Screen object
    Dim Scrn As KEA.Screen
    Dim KW As KeyWait
    Dim MW As MatchWait
    Dim Str, Command, Log As String
    Dim PromptWaitId, DiscWaitId, KeyWaitId As Long
    Dim MatchWaitId, WaitId As Long
    Dim OldSynchronous As Boolean

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the Screen object of the active session
    Set Scrn = Sess.Screen

    ' Set the Synchronous property to True so received host
    ' data is blocked while not in the Wait call. We save the
    ' old value so it can be restored below
    OldSynchronous = Scrn.Synchronous
    Scrn.Synchronous = True

    ' Create a KeyWait object that traps keystrokes - in other
    ' words the keystrokes will not be processed by the emulator
    ' and will not be sent to the host
    Set KW = Scrn.WaitForKeys(False)

    ' Create a MatchWait object that will trap anything coming
    ' from the host. We will use this to prevent the host from
    ' displaying stuff on the session screen while we are using
    ' it
    Set MW = Scrn.WaitForStream("?", , , xRegExp + xStrip)

    ' Connect to the host so the enter key can get trapped by the
    ' KeyWait object - otherwise pressing enter defaults to
    ' connecting to the host
    Sess.Connect

    ' Put a prompt on the screen after clearing it first
    Scrn.Clear
    Scrn.SendInput "Enter a command: "

    ' Save the command which is terminated by a carriage return.
    ' The first time into this loop a keystroke will probably
    ' not be ready so the Name call will result in an implicit
    ' call to the Wait method until a keystroke is pressed
    Do While KW.Name <> Chr(13)
        Str = KW.Name

        ' Append this new keystroke to our command
        Command = Command + Str

        ' Echo the keypress so the user can see it
        Scrn.SendInput Str

        ' Wait for the next keystroke
        KW.Wait
    Loop

    ' Disable the KeyWait object so keystrokes are passed
    ' on to the emulator. This will allow the user to type
    ' and have his keystrokes pass directly on to the host
    KW.Enabled = False

    ' Clear the session screen
    Scrn.Clear

    ' Get rid of our MatchWait object since we no longer need it
    Set MW = Nothing

    ' Toggle the connected state which should force the host to
    ' display the login prompt
    Sess.Connected = False
    Sess.Connected = True

    ' Create a Waits collection to contain our two wait objects
    ' created below. We can use this object to wait for both
    ' events at the same time
    Set Ws = Sys.Waits

    ' Create a MatchWait that will look for a string containing
    ' a dollar sign in the leftmost column of the screen. This is
    ' what the host will send for a user prompt
    PromptWaitId = Ws.Add(Scrn.WaitForString("$", , 1, _
        , , , xRegExp))

    ' Create a DisconnectWait object to catch the host
    ' disconnecting
    DiscWaitId = Ws.Add(Sess.WaitForDisconnect())

    ' Wait for the command prompt which will indicate that
    ' the user has logged in or a disconnect which woould
    ' indicate the user failed to log in. We will wait a maximum
    ' of 30 seconds for something to happen.
    If Ws.Wait(30000) = 0 Then
        MsgBox "We waited for you to login for 30 seconds!"

        ' Return the Synchronous property to its previous value.
        ' NOTICE: It is VERY IMPORTANT to do this since this
        ' property will continue to affect the session after this
        ' program has completed!
        Scrn.Synchronous = OldSynchronous

        Exit Sub
    End If

    ' We no longer need to catch the prompt so we will remove
    ' that MatchWait object from the Waits collection
    Ws.Remove PromptWaitId

    ' We now send the command the user entered earlier and append
    ' a carriage return character
    Scrn.SendKeys Command + Chr(13)

    ' We now want to log everything the user types while
    ' connected to the host and we also want to turn everything
    ' into upper case before it is sent to the host. To
    ' accomplish this we will reenable the KeyWait object we
    ' created above and add it to the Waits collection

    ' NOTICE: We did not have to reenable the KeyWait object
    ' because when you add an object to the Waits collection it
    ' assumes the same Enabled property as the Waits collection
    KW.Enabled = True       ' This is not needed
    KeyWaitId = Ws.Add(KW)  ' This will force KW to be enabled

    ' We also want to catch any string received from the host
    ' containing "user" (in upper or lower case) and replace it
    ' with the actual name of the user (in this case "John
    ' Smith"). We will do this by creating a MatchWait object
    ' that strips the matched string from the input stream and
    ' when that match occurs we will send the user name instead
    MatchWaitId = Ws.Add(Scrn.WaitForStream("user", _
        , , xStrip + xNoCase))

    ' Now we will process keystrokes until the host is
    ' disconnected
    WaitId = Ws.Wait
    Do While WaitId <> DiscWaitId
        If WaitId = KeyWaitId Then
            ' We get the name of the key that was pressed by
            ' using the KW variable. We could have used:
            ' Str = Ws.Item(KeyWaitId).Name
            Str = KW.Name

            ' Log the keystroke to our buffer, if it was a
            ' carriage return log a line feed as well so it will
            ' display on multiple lines when we display it later
            Log = Log + Str
            If Str = Chr(13) Then
                Log = Log + Chr(10)
            End If

            ' Turn the keystroke into its upper case version and
            ' send it to the host as if the user had typed it
            ' that way
            Str = UCase(Str)
            Scrn.SendKeys Str
        ElseIf WaitId = MatchWaitId Then
            ' We have received the string "user" in the input
            ' stream so we replace it with "John Smith". It has
            ' already been stripped from the input stream for us
            ' by the MatchWait object because we specified xStrip
            ' when we created it
            Scrn.SendInput "John Smith"
        End If

        WaitId = Ws.Wait
    Loop

    ' Return the Synchronous property to its previous value
    Scrn.Synchronous = OldSynchronous

    ' Display a log of what the user typed while logged into the
    ' host on the session display after clearing it
    Scrn.Clear
    Scrn.SendInput "You typed:" + Chr(13) + Chr(10) + Log
End Sub


OLE Automation Example 33

Sub Test33()
    Dim Sys As System
    Dim Sess As Session
    Dim FW As FileTransferWait
    Dim FR As FileTransferResult
    Dim Temp As String

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Send all the .txt files in the transfer directory
    Set FW = Sess.SendFile("c:\transfer\*.txt")

    ' Wait for the file transfer to complete
    FW.Wait

    ' Display a message box for each file transferred
    For Each FR In FW
        Temp = "Sent " + FR.Name + " as " + FR.RemoteName

        If FR.EndState = xFileEndFail Then
            Temp = Temp + " (failed) "
        ElseIf FR.EndState = xFileEndCancel Then
            Temp = Temp + " (cancelled) "
        ElseIf FR.EndState = xFileEndSkip Then
            Temp = Temp + " (skipped) "
        ElseIf FR.EndState = xFileEndRename Then
            Temp = Temp + " (renamed) "
        End If
        MsgBox Temp + Str(FR.Size) + " bytes in " + _
            Str(FR.Time) + " milliseconds with " + _
            Str(FR.Errors) + " errors and " + _
            Str(FR.Timeouts) + " timeouts"
    Next FR
End Sub


OLE Automation Example 34

Sub Test34()
    Dim Sys As System
    Dim Sess As Session
    ' In this line we use KEA.Button to differentiate between
    ' the Visual Basic Button object and the KEA Button object
    Dim Bttn As KEA.Button
    Dim i As Integer

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Get the active session - assumes at least one open session
    Set Sess = Sys.ActiveSession

    ' Get the number of buttons on the button pad
    i = Sess.Buttons.Count

    ' Add a new button to the session that when clicked will
    ' run the KEA! macro file named diallong.ktm. In order to
    ' view the new button the SmartPad must be made visible
    ' and large enough to hold the new button
    Set Bttn = Sess.Buttons.Add(xMACRO, "diallong", "Dial")

    ' Test the button as if the user had clicked on it
    Bttn.Invoke

    MsgBox "The macro should now be running and the new " + _
        "button should be in the SmartPad"

    ' Now change the properties of the button we added so it
    ' runs a logoff.ktm macro instead
    Bttn.ActionName = "logoff"
    Bttn.ActionType = xMACRO    ' Not needed since it is the same
    Bttn.Caption = "Log Off"

    MsgBox "The button should now perform a log off when clicked"

    ' Remove the button we created above, the new button
    ' will be the last one created
    Sess.Buttons.Remove i + 1
End Sub


AREA_TYPE Enumeration

xNONE

xPOINT

xSTREAM

xBLOCK


ACTION_TYPE Enumeration

xMACRO

xKEY

xCOMMAND

Note: Only xMACRO is supported in this version.


CHARSET_MODE Enumeration

xCSMMultinational
Maps the regular ASCII character set into the lower (7-bit) character set (GL). Also, maps the supplemental User Preferred Character Set into the upper (8-bit) character set (GR).

xCSMNational
Your Character Set is defined by your selection under National Character Set. Map one of the National Replacement Character Sets (NRC) into the lower (7-bit) character set (GL). The National Character Set selection you make determines the actual NRC set used. National mode uses only 7 bits; therefore, the upper (8-bit) character set (GR) is unavailable.


COLOR_SPEC Enumeration

xColorHLS

xColorRGB


DA_RESPONSE Enumeration

xDAReqKEA
Provides a superset of the VT340 DA Response including some VT420 functions. This is the default.

xDAReq420
This and following values exactly match the DA response for that terminal type.

xDAReq340

xDAReq320

xDAReq240

xDAReq220

xDAReq131

xDAReq125

xDAReq102

xDAReq101

xDAReq100

xDAReqCustom
Responds with the strings stored in CustomPrimaryDA and CustomSecondaryDA properties.

xDAReqKEAterm


DUPLICATE_FILE Enumeration

xDuplFileRename 	Give the incoming file a unique name. KEA! renames the file by adding the numbers 1, 2, 3 etc. to the filename. If the filename ends in a number, that number is incremented. The extension is not changed. (Default)

xDuplFileOverwrite 	Replace the existing file with the incoming file.

xDuplFileDiscard 	Do not accept transfer of the incoming file, and retain the existing file.

xDuplFileRenameOld 	Rename the existing file using the procedure described for Rename.

xDuplFileAppend 	Add the incoming file to the end of the existing file.


EDIT_FNKEYS Enumeration

xEditFnKeysDisabled 	Do not work.

xEditFnKeysImmediate 	Work in local edit mode, sending their normal escape sequences to the application software; do not affect edit mode.

xEditFnKeysPrefix 	Send pressed key's escape sequence to the host; then send a block of data.

xEditFnKeysSuffix 	Send block of data to the host; then send the pressed key's escape sequence.


EDIT_MODE Enumeration

xEditModeInteractive 	Turn off local edit mode.

xEditModeEnabled 	Turn on local edit mode.

xEditModeUnavailable 	Disable local edit mode so neither the host nor keyboard can turn it on.


FILE_PROTOCOL Enumeration

xProtocolAscii

xProtocolKermit

xProtocolXmodem

xProtocolYmodem

xProtocolZmodem

xProtocolFTP


FILE_RESULT Enumeration

xFileEndFail

xFileEndCancel

xFileEndSkip

xFileEndRename

xFileEndOk


FILE_TYPE Enumeration

xFileTypeAutomatic   	Enables the automatic file type processing based on the file extension and file scan options in the configuration dialog box.

xFileTypeBinary   	Send file in binary mode. KEA! sends all 8 data bits, and does not perform character translation. Typically, binary files are object code or executable programs. If you are using the Kermit file transfer protocol, often you need to issue the Set File Type Binary command on the remote Kermit.

xFileTypeText   	Send file in text mode. KEA! translates characters to suit a dissimilar remote system. You might lose data if the file contains any binary data.


FUNCTION_KEY Enumeration

xFKeyLocalAction	Perform the action as marked -- Stop Scroll, Print, ALT, ESC, Break. (default)

xFKeyFKey	Send the VT function key sequence.

xFKeyIgnore	Do nothing.


KEYBOARD_LAYOUT Enumeration

xKeyboardLayoutEnhanced

xKeyboardLayoutPowerStation

xKeyboardLayoutLK250

xKeyboardLayoutLK450


MACRO_RESULT Enumeration

xMacroFail

xMacroCancel

xMacroOk


MATCH_OPT Enumeration

These values can be added together to specify more than one at a time.

xRegExp = 1  	Pattern is a Regular Expression.

xNoCase = 2  	Ignore case.

xStrip = 4  	Remove matched string from the input stream. (WaitForStream only)


NATIONAL_CHARSET Enumeration

xNatNorthAmerican

xNatBritish

xNatFlemish

xNatFrenchCanadian

xNatDanish

xNatFinnish

xNatGerman

xNatDutch

xNatItalian

xNatSwissFrench

xNatSwissGerman

xNatSwedish

xNatNorwegian

xNatFrenchBelgium

xNatSpanish

xNatPortuguese


PRINT_CLOSEIDLE Enumeration

xPrintCloseIdle2secs

xPrintCloseIdle10secs

xPrintCloseIdle30secs

xPrintCloseIdle1min

xPrintCloseIdle2min

xPrintCloseIdle5min

xPrintCloseIdleDisabled


PRINT_EXTENT Enumeration

Used to specify how much of page memory to print.

xPrintSelection	Print the selected area.

xPrintScreen	Print what appears in the emulation window.

xPrintPage	Print the current VT page. If in 401X mode, print the entire Tektronix image.

xPrintAllPages	Print all VT pages. (Does not apply to graphics.)


PRINT_MODE Enumeration

xPrintModeNormal   	Disable continuous printing.

xPrintModeAuto   	Print the current line of text after receiving an end-of-file, line feed, form feed, or vertical tab. In this mode, the data appears on the screen and the printer. KEA! prints each line of text from the screen when it receives a line feed, form feed, or vertical tab. Typically, you use this mode to log screen data.

xPrintModeController   	Send data directly to the printer without displaying the data on the screen. In Printer Controller mode, data received from the host is printed without being displayed on the screen (pass-through mode). If the PrintEmulateANSI property is enabled, KEA! assumes the host sends LA210 ANSI printer sequences and translates them to equivalent Windows printer functions. Otherwise, it assumes the host is configured for the specific printer attached, and sends all data to the printer without translation.


PRINTER_EXTENT Enumeration

xPrintExtentPage   	Prints the entire page even if you are viewing only a portion of that page.

xPrintExtentRegion   	Prints only the scrolling region. Normally, the scrolling region is defined as the complete page.


PS_ATTRIB Enumeration

These values can be added together to specify more than one at a time.

xNORMAL = 0

xBOLD = 1

xINVISIBLE = 2

xBLINKING = 4

xINVERSE = 8

xUNDERLINED = 16


PS_TYPE Enumeration

These values can be added together to specify more than one at a time.

xCHARACTERS = 1

xATTRIBUTES = 2

xCOLORS = 4


SCROLL_MODE Enumeration

xScrollDisabled   	Do not scroll. When the cursor reaches the end of the page, each new line simply overwrites the previous line.

xScrollJump1   	Display after every line.

xScrollJump2   	Display after one-eighth of the window has changed.

xScrollJump4   	Display after one-quarter of the window has changed.


SESSION_TYPE Enumeration

x3270SESSION = 1

x5250SESSION = 2

xVTSESSION = 3


SIXEL_LEVEL Enumeration

xSixelLevelLA210

xSixelLevel1	(default)

xSixelLevel2


SIXEL_PRINT Enumeration

xSixelPrintCompressed   	(Default) Approximately 6 inches wide by 3 inches high.

xSixelPrintRotated   	Approximately 12 inches wide by 8 inches high, rotated to print in landscape orientation on letter size paper.

xSixelPrintExpanded   	Approximately 12 inches wide by 8 inches high.


STATUS_DISPLAY Enumeration

xStatusNone   	Do not display status line.

xStatusIndicator   	KEA! uses it to write its status

xStatusHost   	The host displays information on it.


TEK_CHARSET Enumeration

xTekCharSetAscii   	(Default) Uses the ASCII character set that the host cannot change.

xTekCharSetApl   	Uses the APL character set that the host cannot change.

xTekCharSetProg   	Uses a character set that the host can change with control codes.


TEK_DISPLAY Enumeration

xTekDisplay80x24   	Displays the image using the full emulation window. This stretches the aspect ratio wider than a true Tektronix image. However, it makes the image larger, and easier to read.

xTekDisplay64x24   	(Default) Displays the image using 64 of the 80 columns. This setting gives a true aspect ratio.

xTekDisplay80x30   	Displays the image using all 80 columns, and extends the image vertically to the equivalent of 30 VT lines. This keeps the aspect ratio correct. It makes the image larger, and easier to read.


TEK_GIN Enumeration

xTekGIN_None   	(Default) Sends no terminator code(s) at the end of the report.

xTekGIN_CR   	Sends only a CR.

xTekGIN_CREOT   	Sends control codes CR and EOT following a position report.


TEK_LINEMAP Enumeration

xTekLineStyle   	(Default) Uses normal line styles. Does not perform color mapping.

xTekLineColor   	Maps line styles to colors. All lines appear as solid lines.

xTekLineBoth   	Maps line styles to colors. Maintains original line styles.


TEK_MARGIN Enumeration

xTekMarginNone   	(Default) Never sets the Page Full Condition. After a page fills, writing continues at the top without clearing the screen.

xTekMargin1   	Sets the Page Full Condition when the cursor reaches the bottom of the first margin.

xTekMargin2   	Sets the Page Full Condition when the cursor reaches the bottom of the second margin.


USER_CHARSET Enumeration

xUPCSDEC   	DEC Supplemental

xUPCSISO   	ISO Latin-1

xUPCSIBM   	IBM Graphics set


WINDOW_STATE Enumeration

xMINIMIZED

xNORMAL

xMAXIMIZED


Activate Method

Applies To Object

Session

Description

Makes the specified session the active window.

Syntax

object.Activate

Element	Description
object	The Session object.
Example

 Example


Add Method (of Buttons collection)

Applies To Object

Buttons

Description

Creates a new Button object and adds it to the Buttons collection.

Syntax

Set rc = object.Add (ActionType, ActionName, Caption )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned value, a Button object.
object	The Buttons collection.
ActionType	The type of action to be taken when the user chooses the button. Values are from the ACTION_TYPE enumeration.
ActionName	The name of the action to take. [string]
Caption	The text that appears on the button. [string]
Comments

Using the Set statement, you can assign the returned Button object to a variable, with which you can reference the Button object. Alternatively, you can reference the returned object with the Buttons collection's Item method.

See also Add method of Waits collection.

Example

 Example


Add Method (of Waits collection)

Applies To Object

Waits

Description

Adds an existing object to the Waits collection.

Syntax

rc = object.Add ( Wait )

Element	Description
rc	The returned value, an identifier for the object in the collection. This identifier can be used in the Item method.
object	The Waits collection.
Wait	Any type of wait object: AreaWait, CursorWait, KeyWait, etc.
Comments

A wait-type object cannot be included in more than one Waits collection at a time.

If you have registered a notification (using the StartNotify method) or callback (using the StopCallback method) for a wait-type object, you cannot have that object included in a Waits collection.

Store the returned identifier so that it can be compared with the value returned by the Wait method or Changed property. This will allow the client program to determine which wait-type object in the Waits collection caused the event.

See also Add Method of Buttons collection.

Example

 Example


Area Method

Applies To Object

Screen

Description

Returns an Area object with the defined coordinates.

Syntax

Set rc = object.Area( Row, Col, EndRow, EndCol[, Page][, Type ])

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned value, an Area object.
object	The Screen object.
StartRow	The row where the area begins.
StartCol	The column where the area begins.
EndRow	The row where the area ends.
EndCol	The column where the area ends.
Page	The screen page. Default is 1.
Type	A value from the AREA_TYPE enumeration.
Examples

 Example

 Example


Clear Method

Applies To Objects

AreaWait

CursorWait

DisconnectWait

FileTransferWait

KeyWait

MacroWait

MatchWait

Screen

Wait

Waits

Description

Used with wait-type objects or the Waits collection, the Clear method cancels all events.

Used with the Screen object, it clears the display and resets all character attributes and line attributes to normal.

Syntax

object.Clear

Element	Description
object	Any type of wait object: AreaWait, CursorWait, KeyWait, etc., or the Waits collection, or the Screen object.


ClearComm Method

Applies To Object

Session

Description

Empties the communications buffers, and clears any outstanding conditions that could prevent transmitting or receiving data. It also cancels any escape sequence processing.

Syntax

object.ClearComm

Element	Description
object	The Session object.


ClearHistory Method

Applies To Object

Session

Description

Removes all information from the History buffer.

Syntax

object.ClearHistory

Element	Description
object	The Session object.


Close Method & CloseAll Method
Close Method, CloseAll Method

Applies To Objects

Session  (Close)

Sessions  (CloseAll)

Description

Closes the session, or closes all active sessions.

Syntax

object1.Close

object2.CloseAll

Element	Description
object1	The Session object.
object2	The Sessions collection.
Comments

Because this method may leave dangling references, it is not a clean way to shut down.

Example

 Example


Connect Method

Applies To Object

Session

Description

Connect the session to the specified host.

Syntax

object.Connect [Name]

Element	Description
object	The Session object.
Name	Optional. The name of the host. [string]


Copy Method

Applies To Objects

Area

Screen

Description

Copies the current selection to the Clipboard.

Syntax

object.Copy

Element	Description
object	The Area object or Screen object.
Comments

To copy data from an Area or Screen object, you must first select the object with the Select method. (For the Screen object, you can also use the SelectAll method.)

Example

 Example


CopyPS Method

Applies To Object

Screen

Description

Reads a specified screen location and returns an array which contains the characters and their attributes.

Syntax

rc = object.CopyPS (Row, Col, Len[, Page][, Type] )

Element	Description
rc	The returned array of screen values containing the screen information requested. (See following table.) Each character cell will return 0 to 3 numbers depending on the number of formats specified by Type. The order of these numbers for each cell is as follows: character1, attribute1, color1, character2, attribute2, color2 ....
object	The Screen object.
Row
Col
Len	Number of characters to read. If this extends past the end of the line, it will wrap to the next row. Line terminators are ignored.
Page
Type	The number of values to be returned for each character cell. Constants are from the PS_TYPEenumeration.
Returned Values	Description
characterN	The ASCII representation of the character.
attributeN	A combination of values from the PS_ATTRIB enumeration.
colorN	The background color*16 added to the foreground color.
Comments

The returned array will contain Len*n where n is the number PS_TYPE values requested. For example specifying xCHARACTERS+xATTRIBUTES+xCOLORS will result in an array of Len*3 being returned. In this case the array will contain a character value, an attribute value and a color value repeating in this order for each character cell.


Disconnect Method

Applies To Object

Session

Description

Disconnects from the current communications port. It also requests the modem to drop the telephone connection. A disconnect is always automatically performed when you exit.

Syntax

object.Disconnect

Element	Description
object	The Session object.


Execute Method

Applies To Object

Session

Description

Executes a single macro command from the KEA! macro language. See also RunMacro Method.

Syntax

Set rc = object.Execute( Command )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned value, a MacroWait object.
object	The Session object.
Command	The command to execute. [string]


GetString Method

Applies To Object

Screen

Description

Returns the text from the specified screen location.

Syntax

rc = object.GetString (Row, Col, Len, [Page])

Element	Description
rc	The returned screen text.
object	The Screen object.
Row	The row where the text string begins.
Col	The column where the text string begins.
Len	The length of the text string.
Page	The screen page. Default is 1.
Comments

Wraps at the end of each row, no terminators.

Example

 Example


Invoke Method

Applies To Object

Button

Description

The result is the same as if the user clicked the button.

Syntax

object.Invoke

Element	Description
object	The Button object.
Example

 Example


Item Method (of collections)

Applies To Objects

Buttons

Sessions

Waits

Description

Returns an element in the collection. Item is the default method for Buttons, Sessions, and Waits.

Syntax

Set rc = object.Item( {Index|Id} )

- or -

Set rc = object( {Index|Id} )

Note: Because of the way some languages work this feature may result in an error. In these implementations you will need to create an intermediate variable to hold the collection object or you can use the explicit Item method.

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned object: a Button, Session, or any type of wait object.
object	The Buttons, Sessions, or Waits collection.
Index or Id	Buttons and Sessions use Index. Starts at 1,2,3,4 Waits uses Id, obtained from another function. This Id must have been returned by the Waits.Add or Waits.Wait methods.
Example

 Example


Item Method (of FileTransferWait object)

Applies To Object

FileTransferWait

Description

Returns the result of a transfer of one file in a single or multiple file transfer. The returned object contains information about the file that was (or wasn't) transferred.

Syntax

Set rc = object.Item( Index )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned FileTransferResult object.
object	The FileTransferWait object.
Index	Starts at 1,2,3,4
Example

 Example


NextLarger Method

Applies To Object

Font

Description

Increases the font size.

Syntax

rc = object.NextLarger( )

Element	Description
rc	The returned boolean value.
object	The Font object.


NextSmaller Method

Applies To Object

Font

Description

Decreases the font size.

Syntax

rc = object.NextSmaller( )

Element	Description
rc	The returned boolean value.
Object	The Font object.


Paste Method

Applies To Objects

Area

Screen

Description

Sends the selected text to the host. (If no text is selected, sends the text in the Clipboard, if any.) Whether or not line terminators are sent with the data depends on the type of selection. If stream select, the selection is sent with the "Data" formatting--without line terminators. If block select, the selection is pasted with the "Lines" formatting--a terminator at the end of each line.

You cannot paste graphics to the host.

Syntax

object.Paste

Element	Description
object	The Area object or Screen object.


Print Method

Applies To Object

Session

Description

Prints selected portions of page memory, including text and graphics

Syntax

object.Print Extent, Graphics

Element	Description
object	The Session object.
Extent	How much of page memory to print. Values are from the PRINT_EXTENT enumeration.
Graphics	A boolean value which indicates whether graphics should be printed or not.


PutString Method

Applies To Object

Screen

Description

The result is the same as if the user typed the text at the keyboard.

Syntax

object.PutString Text

Element	Description
object	The Screen object.
Text	The text to put.
Comments

See also the SendKeys method.

Example

 Example


Quit Method

Applies To Object

System

Description

Closes all active sessions. The same as CloseAll.

Syntax

object.Quit

Element	Description
object	The System object.


ReceiveFile Method

Applies To Object

Session

Description

Receives a file from the host using the currently configured file transfer protocol. See also SendFile.

Syntax

Set rc = object.ReceiveFile( [Files][, Path] )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned value, a FileTransferWait object.
Object	The Session object.
Files	The source, as a list of files delimited by spaces. The list can contain wildcards. Filenames containing spaces may be enclosed in double quotes.
Path	Destination path. May contain a filename which will be used for naming the first file.
Example

 Example


Remove Method

Applies To Objects

Buttons

Waits

Description

Removes an object from the collection.

Syntax

object.Remove {Index|Id}

Element	Description
object	The Buttons or the Waits collection
Index or Id	The Buttons collection uses a 1-based index. The Waits collection uses an Id value. This Id must have been returned by the Waits.Add or Waits.Wait method.
Examples

 Example

 Example


RemoveAll Method

Applies To Object

Buttons

Waits

Description

Removes all the objects from the collection. See also Remove.

Syntax

object.RemoveAll

Element	Description
object	The Buttons or Waits collection.


Reset Method

Applies To Objects

AreaWait

CursorWait

DisconnectWait

FileTransferWait

KeyWait

MacroWait

MatchWait

Wait

Waits

Description

If the object is enabled, this behaves as if Enabled were set to False and then back to True. Otherwise this has no effect.

Syntax

object.Reset

Element	Description
object	Any of the above-listed objects.


Restart Method & RestartAll Method
Restart Method, RestartAll Method

Applies To Objects

Session  (Restart)

Sessions  (RestartAll)

Description

Returns the display to its power-up state. This affects emulation states only, not communications, screen, character set modes, UDKs, or terminal type.

Syntax

object1.Restart

object2.RestartAll

Element	Description
object1	The Session object.
object2	The Sessions collection.
Example

This example restarts all sessions that are open.

Sub Main()
Dim Sys As System
Set Sys = CreateObject("KEA.System")

Sys.Sessions.RestartAll
End Sub


RunMacro Method

Applies To Object

Session

Description

Runs a macro file written in the KEA! macro language. See also Execute Method.

Syntax

Set rc = object.RunMacro( File )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned value, a MacroWait object.
Object	The Session object.
File	The KEA! macro language file to be run.
Example

 Example


Save Method

Applies To Object

Session

Description

Saves the current configuration and user mappings under the current configuration file name. The current session name is assigned.

Syntax

object.Save

Element	Description
object	The Session object.


SaveAs Method

Applies To Object

Session

Description

Saves the current configuration and user mappings under the specified configuration file name (session name).

Syntax

object.SaveAs Name

Element	Description
object	The Session object.
Name	Name to use for saving the session.


Search Method

Applies To Object

Screen

Description

Searches from the specified screen position to the end of the page. Returns an Area object with the text specified in the search.

Syntax

Set rc = object.Search( Text[, Row][, Col][, Page][, Occurrence] )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned value, an Area object.
object	The Screen object.
Text	A regular expression.
Row	Defaults to 1.
Col	Defaults to 1.
Page	Defaults to 1.
Occurrence	May be 1 or greater, or -1 to get the last occurrence. Defaults to 1.
Comments

If the Screen changes at those coordinates, the Value property of the Area changes.

If Search does not find the specified text, the Area object's Value property is set to an empty string, its Type property is set to xNONE, and its coordinate properties are set to -1.

Example

 Example


Select Method

Applies To Objects

Area

Screen

Description

For the Area object, the method selects the object.

For the Screen object, the method selects the area defined by the coordinates and returns an Area object.

Syntax

object.Select

Element	Description
object	The Area object.
Syntax

Set rc = object.Select( StartRow, StartCol, EndRow, EndCol[, Page] )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned value, an Area object.
Object	The Screen object.
StartRow	The row where the area begins.
StartCol	The column where the area begins.
EndRow	The row where the area ends.
EndCol	The column where the area ends.
Page	Defaults to 1.
Example

 Example


SelectAll Method

Applies To Object

Screen

Description

Selects the currently viewed page.

Syntax

Set rc = object.SelectAll( )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned value, an Area object.
object	The Screen object.
Example

 Example


SendFile Method

Applies To Object

Session

Description

Sends a file to the host using the currently configured file transfer protocol. See also ReceiveFile.

Syntax

Set rc = object.SendFile( [Files][, HostName] )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned value, a FileTransferWait object.
object	The Session object.
Files	Space-delimited source file list. May contain wildcards and filenames may be enclosed in double quotes.
HostName	Host name to use for renaming the first file.


SendInput Method

Applies To Object

Screen

Description

Sends the specified text to the Screen object, simulating incoming data from the host.

Syntax

object.SendInput Text

Element	Description
object	The Screen object.
Text	The text to send.
Example

 Example


SendKeys Method

Applies To Object

Screen

Description

Sends a sequence of keys to the terminal as if they had been typed by the user. See also PutString.

Syntax

object.SendKeys Text

Element	Description
object	The Screen object.
Text	A sequence of keys to send. Key names, and mnemonics from the following table must be enclosed in angle brackets < >. Regular single-character keystrokes may appear without the angle brackets.
VT Function Keys Table

Note: The keypad functions will send either numbers or control sequences, depending on the current mode of the keypad.

VT Function Keys	Mnemonic	VT Function Keys	Mnemonic
Backspace	Backspace	Find	Find
Break Signal	Break	Insert	Insert Here
Compose Sequence	Compose	Hold	Hold
Cursor Down	Down	Keypad -	Keypad -
Cursor Left	Left	Keypad ,	Keypad ,
Cursor Right	Right	Keypad Enter	Keypad Enter
Cursor Up	Up	Keypad .	Keypad .
Escape	Esc	Keypad 0	Keypad 0
F1	F1	Keypad 1	Keypad 1
F2	F2	Keypad 2	Keypad 2
F3	F3	Keypad 3	Keypad 3
F4	F4	Keypad 4	Keypad 4
F5	F5	Keypad 5	Keypad 5
F6	F6	Keypad 6	Keypad 6
F7	F7	Keypad 7	Keypad 7
F8	F8	Keypad 8	Keypad 8
F9	F9	Keypad 9	Keypad 9
F10	F10	Next Screen	Next
F11	F11	PF1	PF1
F12	F12	PF2	PF2
F13	F13	PF3	PF3
F14	F14	PF4	PF4
F15	F15	Previous Screen	Prev
F16	F16	Print Screen	Print
F17	F17	Remove	Remove
F18	F18	Select	Select
F19	F19	Setup	Setup
F20	F20	Tab	Tab

Example

 Example


StartCallback Method

Applies To Objects

AreaWait

CursorWait

DisconnectWait

FileTransferWait

KeyWait

MacroWait

MatchWait

Wait

Waits

Description

This method is used to register an OLE Automation interface that will be called whenever a new event is triggered on a wait-type object. The passed interface must have an "EventTriggered" method taking a boolean value as its parameter which will indicate the success or failure of the event as in the following line of C code:

void EventTriggered( boolean Success )

Used with the Waits collection, it will be called whenever any wait-type object in the collection has an event triggered.

Syntax

object.StartCallback pDispatch

Element	Description
object	Any type of wait object: AreaWait, CursorWait, KeyWait, etc., or the Waits collection.
Pdispatch	The Idispatch interface.


StartNotify Method

Applies To Objects

AreaWait

CursorWait

DisconnectWait

FileTransferWait

KeyWait

MacroWait

MatchWait

Wait

Waits

Description

This method is used to register a window that will be called whenever a new event is triggered on a wait-type object.

Used with the Waits collection, this method is used to register a window that will be called whenever a new event is triggered on a wait-type object.

Syntax

Element	Description
object	Any type of wait object: AreaWait, CursorWait, KeyWait, etc. or the Waits collection.
hWnd	Window to be notified. Must be a valid Windows window handle.
WMsg	A message value passed to the window for a successful event.
Wparam	One of two parameter values passed to the window for a successful event.
Iparam	One of two parameter values passed to the window for a successful event.
WMsgFail	A message value passed to the window for a failure event.
WParamFail	One of two parameter values passed to the window for a failure event.
LParamFail	One of two parameter values passed to the window for a failure event.


StopCallback Method

Applies To Objects

AreaWait

CursorWait

DisconnectWait

FileTransferWait

KeyWait

MacroWait

MatchWait

Wait

Waits

Description

Stops the callback mechanism from being used.

Syntax

object.StopCallback

Element	Description
object	Any type of wait object: AreaWait, CursorWait, KeyWait, etc. or the Waits collection.


StopNotify Method

Applies To Objects

AreaWait

CursorWait

DisconnectWait

FileTransferWait

KeyWait

MacroWait

MatchWait

Wait

Waits

Description

Stops the notification mechanism from being used.

Syntax

object.StopNotify

Element	Description
object	Any type of wait object: AreaWait, CursorWait, KeyWait, etc. or the Waits collection.


Wait Method

Applies To Objects

AreaWait

CursorWait

DisconnectWait

FileTransferWait

KeyWait

MacroWait

MatchWait

Wait

Waits

Description

For wait-type objects, a call to the Wait method stops further processing in the client program and only returns when Changed is True or a timeout period expires. For the Waits object the Wait method stops further processing in the client program and only returns when Changed is True for any of the contained wait-type objects or a timeout period expires.

Syntax

rc = object.Wait( [Timeout] )

Element	Description
rc	The returned value. If the object is a wait-type object, the value is boolean indicating success (True) or timeout (False). If the object is Waits, the value is a number indicating the ID of the wait-type object which caused the event or 0 on timeout.
object	Any type of wait object: AreaWait, CursorWait, KeyWait, etc., or the Waits collection.
Timeout	Maximum amount of time to wait for an event to occur.  Defaults to 0 or the timeout parameter that was provided (if any) in the method that created the wait-type object.  A value of 0 indicates forever--not an immediate return. The time is given in milliseconds.
Examples

 Example

 Example

 Example


WaitForCursor Method

Applies To Object

Screen

Description

Waits until the cursor is at the specified location.

Syntax

Set rc = object.WaitForCursor( [Row][, Col][, Page] )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned value, a CursorWait object.
object	The Screen object.
Row	Default is 1.
Col	Default is 1.
Page	Default is 1.
Example

 Example


WaitForCursorMove Method

Applies To Object

Screen

Description

Waits until the cursor has moved from its current position.

Syntax

Set rc = object.WaitForCursorMove( )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned value, a CursorWait object.
object	The Screen object.
Example

 Example


WaitForDisconnect Method

Applies To Object

Session

Description

Waits until the host has disconnected from the session.

Syntax

Set rc = object.WaitForDisconnect( )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned value, a DisconnectWait object.
Object	The Session object.
Example

 Example


WaitForKeys Method

Applies To Object

Screen

Description

Waits for the user to press a key.

Syntax

Set rc = object.WaitForKeys( [Process] )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned value, a KeyWait object.
Object	The Screen object.
Process	Indicates whether keystrokes should continue to be processed by the emulator. If set to False then keystrokes are not sent to the emulator. Default is False.
Comments

If more than one enabled KeyWait object exists for a session with the Process parameter having been set to False when the object was created, some KeyWait objects for that session may not receive keys. This is because only one KeyWait object is permitted to "capture" a key and prevent it from being processed by the emulator. Once a KeyWait object has captured a key in this way, that key is not sent to other KeyWait objects for the session. More than one KeyWait object may receive the same key however if the Process flag was set to True.

Examples

 Example

 Example

 Example


WaitForStream Method

Applies To Object

Screen

Description

Waits until the specified text or expression appears in the host data stream.

Syntax

Set rc = object.WaitForStream( Text[, Idle][, Timeout][, Options] )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned value, a MatchWait object.
object	The Screen object.
Text	The string or expression (as determined by Options) to be found.
Idle	The amount of time the data stream must be idle (no received data) after having matched the text.
Timeout	The default amount of time to wait.
Options	Use combined values from the MATCH_OPT enumeration.
Example

 Example


WaitForString Method

Applies To Object

Screen

Description

Waits until the specified text appears on the screen.

Syntax

Set rc = object.WaitForString( Text[, Row][, Col][, Page][, Idle][, Timeout][, Options] )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned value, a MatchWait object.
Object	The Screen object.
Text	The string or expression (as determined by Options) to be found.
Row	Default is 0.
Col	Default is 0.
Page	Default is 0.
Idle	The amount of time the data stream must be idle (no received data) after having matched the text.
Timeout	The default amount of time to wait.
Options	Use combined values from the MATCH_OPT enumeration.
Comments

If you don't specify a screen location (row, column, or page) or the specified values are 0, WaitForString can receive the text string in any location to be successful. Only those values that are specified and not 0 will be used. For example, to match on column 2 but any row or page use ( ...2, 0, 0... )

Examples

 Example

 Example


WaitHostQuiet Method

Applies To Object

Screen

Description

Waits for the emulator or the host to not send data for a specified number of milliseconds.

Syntax

Set rc = object.WaitHostQuiet( Time )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned value, a MatchWait object.
object	The Screen object.
Time	Time to be idle in milliseconds.


WaitUntilChanged Method

Applies To Object

Area

Description

Waits for the screen area to change and then remain unchanged for a specified amount of time.

Syntax

Set rc = object.WaitUntilChanged( Idle )

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned value, a AreaWait object.
Object	The Area object.
Idle	The amount of time in milliseconds that the screen must not change after having changed.


Internal Use Only


Area Object

Description

Provides access to a defined area of the screen.

You can create Area objects using methods and properties of the Screen object, such as the Area method, Search method, Select method, SelectAll method, and Selection property.

You can also create Area objects using the Area property of the AreaWait object.

Properties	Methods
Application	Copy
Bottom	Paste
Left	Select
Page	WaitUntilChanged
Parent
Right
Top
Type
Value (Default)
Example

 Example


AreaWait Object

Description

A wait-type object that can be used to control and check on the status of a WaitUntilChanged().

To create an AreaWait object, use the WaitUntilChanged method.

Properties	Methods
Application	Clear
Area (Default)	Reset
Changed	StartCallback
Enabled	StartNotify
Parent	StopCallback
	StopNotify
	Wait


Button Object

Description

A Button object is equivalent to one of KEA!'s user-defined buttons, which can appear in a SmartPad or on the status bar.

To create a Button object, use the Add method (1) of the Buttons object.

Properties	Methods
ActionName	Invoke
ActionType
Application
Caption
Parent
Example

 Example


Buttons Object

Description

A Buttons object is equivalent to one or more of KEA!'s user-defined buttons, which can appear in a SmartPad or on the status bar.

To create a Buttons collection use the Buttons property with the Session object.

Properties	Methods
Application	Add
Count	Item (Default)
Parent	Remove
	RemoveAll
Example

 Example


Connectivity Object

Description

The Connectivity object is equivalent to KEA!'s Communications dialog box (on the Options menu).

To retrieve a Connectivity object, use the Connectivity property of the Session object.

Properties

Application

Options

Parent

Type (Default)


Cursor Object

Description

The Cursor object allows you to change the appearance of the cursor.

To retrieve a Cursor object, use the Cursor property of the Session object.

Properties

Blink

Block

Visible


CursorWait Object

Description

A wait-type object that can be used to control and check on the status of a WaitForCursor() or WaitForCursorMove().

To create a CursorWait object, use the WaitForCursor or WaitForCursorMove method.

Properties	Methods
Application	Clear
Changed	Reset
Col	StartCallback
Enabled	StartNotify
Page	StopCallback
Parent	StopNotify
Row	Wait
Example

 Example


DisconnectWait Object

Description

A wait-type object that can be used to control and check on the status of a WaitForDisconnect().

To create a DisconnectWait object, use the WaitForDisconnect method.

Properties	Methods
Application	Clear
Changed	Reset
Connected (Default)	StartCallback
Enabled	StartNotify
Parent	StopCallback
	StopNotify
	Wait
Example

 Example


FileTransferResult Object

Description

The FileTransferResult object contains information about a single file in a multi-file transfer. From its properties, you can tell the name of the file, its size, how long the transfer took, etc.

To retrieve a FileTranferResult object, use the Item method of a FileTransferWait object.

Properties

EndState

Errors

Name (Default)

RemoteName

Size

Time

Timeouts

Example

 Example


FileTransferScheme Object

Description

The FileTransferScheme object is equivalent to KEA!'s File Transfer dialog box (Transfer menu, Options command).

To retrieve a FileTransferScheme object, use the FileTransferScheme property of the Session object.

Properties

Application	Quiet
CrashRecovery	ReceiveTo
CreatePath	RecurseSubdirectories
DuplicateName	ScanUnknownType
FileType	SendFullPath
Parent	TextFiles
Protocol	UsePath


FileTransferWait Object

Description

A wait-type object that can be used to control and check on the status of a ReceiveFile() or a SendFile().

To create FileTransferWait object, use the ReceiveFile method or SendFile method of the Session object.

Properties	Methods
Application	Clear
Changed	Item
Count	Reset
Enabled	StartCallback
FileEnd (Default)	StartNotify
Parent	StopCallback
	StopNotify
	Wait
Examples

 Example

 Example


Font Object

Description

The Font object allows you to change the appearance of the screen font.

To retrieve a Font object, use the Font property of the Session object.

Properties	Methods
Application	NextLarger
AutoSize	NextSmaller
Parent
Size


HostOptions Object

Description

The HostOptions object is equivalent to many of the options on KEA!'s Options menu.

To retrieve a HostOptions object, use the HostOptions property of the Screen object.

Properties

AnswerBack	F4Key	PrintTerminator
Application	F5Key	PrintUseBitmap
AutoWrap	GraphicsBitmap	Scroll
BackspaceDoesDelete	GraphicsCursor	SixelBackgroundPrinting
CharacterSetMode	GraphicsDisplayList	SixelColorPrinting
Columns80	GraphicsMacroReport	SixelColorSpecification
CursorKeyModeApplication	HorizontalCoupling	SixelGraphicsLevel
CustomPrimaryDA	InverseScreen	SixelIgnorePrintRequests
CustomSecondaryDA	KeyboardLayout	SixelPrintOption
DAResponse	KeypadModeApplication	SixelScrolling
DisplayControls	Lines	StatusDisplay
EditEOBChars	LocalEcho	StyledLines
EditEOLChars	LockUserFeatures	TektronixAutoPrint
EditEraseAll	LockUserKeys	TektronixBSDoesDEL
EditFunctionKeys	MarginBell	TektronixCharacterSet
EditGuardedAreaAll	NationalCharacterSet	TektronixCRAddsLF
EditKeyImmediate	NewLine	TektronixDELIgnored
EditLineTransmit	PageCoupling	TektronixDisplay
EditMode	Parent	TektronixEnlargedCharacters
EditMultipleArea	PrintAutoFontSelect	TektronixGINTerminator
EditNewLineScrolling	PrintBackground	TektronixLFAddsCR
EditpadVTLike	PrintCloseIdle	TektronixLineStyleMap
EditSelectedAreaAll	PrintColors	TektronixMarginControl
EditSpaceCompression	PrintEmulateANSI	TektronixVectorFont
EditTransferTermination	PrintExtent	TektronixVT640Compatible
EditTransmitImmediate	PrintFont	TerminalMode
EditVT131Transfer	PrintFontSize	UserPreferredCharacterSet
F1Key	PrintFontStyle	VerticalCoupling
F2Key	PrintMode	WarningBell
F3Key	PrintReverseBlackWhite


KeyWait Object

Description

A wait-type object that can be used to control and check on the status of a WaitForKeys(). Each KeyWait object queues keystrokes until they are needed by the object.

To create a KeyWait object, use the WaitForKeys method.

Properties	Methods
Application	Clear
Changed	Reset
Enabled	StartCallback
Name (Default)	StartNotify
Parent	StopCallback
	StopNotify
	Wait
Comments

If more than one enabled KeyWait object exists which had the Process parameter set to False when it was created, some KeyWait objects for that session may not receive keys. This is because only one KeyWait object is permitted to "capture" a key and prevent it from being processed by the emulator. After a KeyWait object has captured a key in this fashion, that key is not sent to other KeyWait objects for the session. However, if the Process flag was set to True, more than one KeyWait object may receive the same key.

If the following Visual Basic code is executed (Sess assumed already set) user keystrokes will not be sent to the host and so will not be echoed to the screen.

Dim KW as KeyWait
Set KW = Sess.Screen.WaitForkeys

If the KeyWait object is destroyed or disabled or the Reset method is called, the queued keystrokes will be sent on to the host. The object will be destroyed when it goes out of scope or is set to "Nothing."

Set KW = Nothing

or

KW.Enabled = False

or

KW.Reset

If a KeyWait object is added to a Waits collection it will remain in existence even after the original variable (KW) is gone.

Examples

 Example

 Example


MacroWait Object

Description

A wait-type object that can be used to control and check on the status of a RunMacro() or Execute().

To create a MacroWait object, use the Execute method or RunMacro method.

Properties	Methods
Application	Clear
Changed	Reset
Enabled	StartCallback
MacroEnd (Default)	StartNotify
Parent	StopCallback
	StopNotify
	Wait
Comments

If a MacroWait object is canceled (by the Clear method) or destroyed while the associated KEA! macro is still running, that KEA! macro and any other running KEA! macros stop.

Example

 Example


MatchWait Object

Description

A wait-type object that can be used to control and check on the status of a WaitHostQuiet(), WaitForStream() or WaitForString().

To create a MatchWait object, use the WaitForStream, WaitForString, or WaitHostQuiet method.

Properties	Methods
Application	Clear
Changed	Reset
Col	StartCallback
Enabled	StartNotify
Page	StopCallback
Parent	StopNotify
Row	Wait
String (Default)
Example

 Example


Screen Object

Description

Provides access to the contents of the host screen's presentation space.

You can retrieve a Screen object with the Screen property of the Session object.

Properties	Methods
Application	Area
Col	Clear
Cols	Copy
HostName (Default)	CopyPS
HostOptions	GetString
Local	Paste
Page	PutString
Pages	Search
Parent	Select
Row	SelectAll
Rows	SendInput
Selection	SendKeys
Synchronous	WaitForCursor
	WaitForCursorMove
	WaitForKeys
	WaitForStream
	WaitForString
	WaitHostQuiet
Example

 Example


SerialOptions Object

Description

Provides access to terminal connectivity options.

To retrieve a SerialOptions object, use the Options property of a Connectivity object.

Properties

Application

HostName (Default)

Parent


Session Object

Description

Provides access to host data and session functionality. The Session object contains sub-objects, such as the Screen object.

Session objects are created by the ActiveSession property of the System object, or the Item method of the Sessions object.

Or you can call CreateObject() to start a new KEA! session.

Set Sess = CreateObject("KEA!.Session")

A more direct way to start a session, however, is by retrieving an existing Session object with the GetObject function, as shown in the following two examples. The second example creates a new Session if none are running with the named .KTC file

Set Sess = GetObject(, "KEA!.Session")

Set Sess = GetObject("c:\keaterm\win\user\test.ktc")

Properties

Application	FullName	Saved
Buttons	Height	Screen
Caption	History	StatusBar
Capture	hWnd	Title
Connected	Left	Top
Connectivity	Menu	Type
Cursor	Name (Default)	Visible
FileTransferScheme	Parent	Width
Font	Path	WindowState

Methods

Activate	Disconnect	RunMacro
ClearComm	Execute	Save
ClearHistory	Print	SaveAs
Close	ReceiveFile	SendFile
Connect	Restart	WaitForDisconnect
Example

 Example


Sessions Object

Description

The Sessions object is a collection of Session objects, reflecting individual sessions that are currently open. By accessing the Sessions collection, you can cycle through the sessions and perform actions.

To retrieve a Sessions object, use the Sessions property of the System object.

Properties	Methods
Application	CloseAll
Count	Item (Default)
Parent	RestartAll
Example

 Example


System Object

Description

Top-level object, providing access to all objects in all open sessions.

To retrieve a System object, you can use the Application property of various objects or the Parent property of the Session object.

Or you can use the CreateObject function to create a new System object or get an already running System object as follows:

Set Sys = CreateObject("KEA.System")

Properties	Methods
ActiveSession	Quit
Application
FullName
Name
Parent
Sessions
Version
Waits
Example

 Example


Wait Object

Description

The all-purpose Wait object is never returned by a function. However, the more specific wait-type objects (listed below) are all based on it. A definition of this type is useful if you want to declare a variable to which you could later assign any of the more specific retrieved wait-type objects.

AreaWait

CursorWait

DisconnectWait

FileTransferWait

KeyWait

MacroWait

MatchWait

All wait-type objects include this minimum set of properties and methods.

Properties	Methods
Application	Clear
Changed	Reset
Enabled	StartCallback
Parent	StartNotify
	StopCallback
	StopNotify
	Wait


Waits Object

Description

The Waits object is a collection object used to control and check on the status of a number of wait-type objects (listed below). The Waits object acts like other wait-type objects but allows the client program to operate on a collection of wait-type objects all at once.

To create a Waits object, use the Waits property of the System object.

AreaWait

CursorWait

DisconnectWait

FileTransferWait

KeyWait

MacroWait

MatchWait

Properties	Methods
Changed	Add
Count	Clear
Enabled	Item (Default)
	Remove
	RemoveAll
	Reset
	StartCallback
	StartNotify
	StopCallback
	StopNotify
	Wait
Comments

The Waits object may be used when there are a number of different events which may occur. A Waits object Wait call will return when the first event occurs.

Examples

 Example

If the host could take many seconds to respond, you may not want the client program to appear unresponsive for such a long time. The user may want to cancel the whole process if nothing else or the client program may carry on asking for more input while the host is connecting.

To accomplish this the Waits Wait method may be replaced with a read of the Waits Changed property. This will return almost immediately and allow other processing to be done. If it returns 0, none of the events in the Waits collection have occurred. When one event does occur its identifier will be returned.

 Polling Example


ActionName Property

Applies To Object

Button

Description

Returns or sets the action associated with a button as a string. Read-write.

Syntax

object.ActionName

Element	Description
object	The Button object.
Example

 Example


ActionType Property

Applies To Object

Button

Description

Returns or sets the type of action associated with a button. Read-write.

Syntax

object.ActionType

Element	Description
object	The Button object.
Comments

The values set or returned are from the ACTION_TYPE enumeration set.

Example

 Example


ActiveSession Property

Applies To Object

System

Description

Returns the currently active Session object. Read-only.

Syntax

Set rc = object.ActiveSession

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned Session object.
object	The System object.
Comments

You can assign the returned object to a variable or property with the Set statement.

Example

After initializing the object variable sess with a reference to the active session, this example displays the name of the session.

 Example


AnswerBack Property

Applies To Object

HostOptions

Description

Returns or sets the answerback string. The terminal sends this string in response to an ENQ (Ctrl E) from the host. You can set up to 31 characters.

Syntax

object.AnswerBack

Element	Description
object	The HostOptions object.
Comments

Specify control codes in the range 0 to 31 as a circumflex ^ followed by a character. You also enter any special code as a circumflex followed by three decimal numbers.


Application Property

Applies To Objects

Area

AreaWait

Button

Buttons

Connectivity

CursorWait

DisconnectWait

FileTransferScheme

FileTransferWait

Font

HostOptions

KeyWait

MacroWait

MatchWait

Screen

SerialOptions

Session

Sessions

System

Wait

Description

Returns the System object. Read-only.

Syntax

Set rc = object.Application

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned System object.
object	One of the above-listed objects.
Example

 Example


Area Property

Applies To Object

AreaWait

Description

Returns the Area object. Read-only.

Syntax

Set rc = object.Area

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned Area object.
Object	The AreaWait object.
Comments

Area is the default Property of the Area object.

Reading the Area property causes an implicit call to the Wait method, if an event has not occurred since the object was created or since the last call to Reset.


AutoSize Property

Applies To Object

Font

Description

Sets the font to Auto Size or fixed size (at the size currently in use), or returns its status -- True if Auto Size is selected, False if a specific font size has been selected. Read-write.

Syntax

object.AutoSize

Element	Description
object	The Font object.


AutoWrap Property

Applies To Object

HostOptions

Description

Sets or returns the status of the Auto Wrap feature. If true, text automatically wraps to the next line when it reaches the right margin. Read-write.

Syntax

object.AutoWrap

Element	Description
object	The HostOptions object.


BackspaceDoesDelete Property

Applies To Object

HostOptions

Description

Sets or returns what the BACKSPACE key sends when pressed. If true, sends the DEL character (default). If false, sends the BS character. Read-write.

Syntax

object.BackspaceDoesDelete

Element	Description
object	The HostOptions object.


Blink Property

Applies To Object

Cursor

Description

Sets or returns the status of the cursor blink feature. If true, the cursor blinks. If false, the cursor is steady. Read-write.

Syntax

object.Blink

Element	Description
object	The Cursor object.


Block Property

Applies To Object

Cursor

Description

Sets or returns the status of the cursor appearance . If true, the cursor appears as a block. If false, the cursor appears as an underline. Read-write.

Syntax

object.Block

Element	Description
object	The Cursor object.


Bottom Property

Applies To Object

Area

Description

Returns or sets the ending row of the Area object. Read-write.

Syntax

object.Bottom

Element	Description
object	The Area object.
Comments

You can set the Bottom property to shrink or expand an Area object. For example, if you initially defined an area with a bottom row of ten, you can set the bottom row to fifteen, thereby expanding the size of the area.

You can also adjust the size of the Area object with the Top, Left, and Right properties.

Example

 Example


Buttons Property

Applies To Object

Session

Description

Returns the Buttons collection. Read-only.

Syntax

Set rc = object.Buttons

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned Buttons collection.
Object	The Session object.
Example

 Example


Caption Property

Applies To Objects

Button

Session

Description

Used with a Button object, the Caption property returns or sets the button text. Read-write.

Used with a Session object, the Caption property sets the Title bar text. Write-only.

Syntax

object.Caption

Element	Description
object	The Button object, or Session object.
Example

 Example


Capture Property

Applies To Object

Session

Description

Sets the object to enable or disable File Capture or returns its status -- True if File Capture enabled, False if disabled. Read-write.

Syntax

object.Capture

Element	Description
object	The Session object.
Comments

A File Capture saves all data received from the host and stores it in a named file. You can use this as a temporary disable during a file capture.


Changed Property

Applies To Objects

AreaWait

CursorWait

DisconnectWait

FileTransferWait

KeyWait

MacroWait

MatchWait

Wait

Waits

Description

Use this to determine if of one of the wait-type objects has changed. Read-only

The Changed property returns the value True for the following objects if the object is enabled and the state being waited for is in effect:

CursorWait created by the WaitForCursor method,

DisconnectWait,

FileTransferWait,

MacroWait,

MatchWait created by the WaitForString method.

For other wait-type objects the Changed property returns the value True if the object is enabled and an event has occurred since the object was created or the last time Changed, Reset or Wait was called. In all other cases this property returns False.

Syntax

object.Changed

Element	Description
object	Any of the above-listed objects.
Comments

Reading the Changed property when it returns True also updates the wait-type object to reflect the new state. Most properties of a wait-type object reflect the last event to occur. When Changed returns True these properties have been updated to reflect the new event.

For example, reading the Changed property of a KeyWait object which has a keystroke queued will de-queue the keystroke and set the object's Name property to that of the new keystroke. If Changed was not called, the Name property would return the previous keystroke if one was available, or would cause an implicit call to the Wait method to wait for a keystroke.

Example

 Example


CharacterSetMode Property

Applies To Object

HostOptions

Description

Selects or returns the character set mode in use: Multinational 8-bit or National 7-bit. Read-write.

Syntax

object.CharacterSetMode

Element	Description
object	The HostOptions object.
Comments

To send and receive codes in the GR set, you need 8 bits of data. If you use a serial port, ensure that your port can send all 8 bits.

The values set or returned are from the CHARSET_MODE enumeration set.


Col Property

Applies To Objects

CursorWait

MatchWait

Screen

Description

Returns the column position of the cursor. Read-only.

Syntax

object.Col

Element	Description
object	Any of the above-listed objects.
Comments

Reading the Col property causes an implicit call to the Wait method for the following objects if an event has not occurred since the object was created or since the last call to Reset:

CursorWait created by the WaitForCursorMove method,

MatchWait created by the WaitForStream or WaitHostQuiet methods.

Example

 Example


Cols Property

Applies To Object

Screen

Description

Returns the number of columns in the presentation space. Read-only.

Syntax

object.Cols

Element	Description
object	The Screen object.
Example

 Example


Columns80 Property

Applies To Object

HostOptions

Description

Sets or returns the status of the text page width. If true, the page is 80 columns wide. If false, the page is 132 columns wide. Read-write.

Syntax

object.Columns80

Element	Description
object	The HostOptions object.
Comments

When you change the setting, the screen is cleared.


Connected Property

Applies To Objects

Session

DisconnectWait

Description

Used with a Session object, the property returns the connection status of the session -- True if connected, False if disconnected. Also connects or disconnects the session. Read-write.

Used with a DisconnectWait object, the property returns the connection status of the session -- True if connected, False if disconnected. Read-only.

Syntax

object.Connected

Element	Description
object	The Session object or DisconnectWait object.
Comments

Connected is the default Property of the DisconnectWait object.

Example

 Example


Connectivity Property

Applies To Object

Session

Description

Returns the Connectivity object. Read-only.

Syntax

Set rc = object.Connectivity

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned Connectivity object.
object	The Session object.


Count Property

Applies To Objects

Buttons

FileTransferWait

Sessions

Waits

Description

Returns the number of items in the collection of objects. Read-only.

Syntax

object.Count

Element	Description
object	Any of the above-listed objects.
Example

 Example


CrashRecovery Property

Applies To Object

FileTransferScheme

Description

Available for Zmodem only. If this property is enabled, before Zmodem starts to receive a file it checks if a local file already exists with the same name. If a local file exists, Zmodem tries to determine if the local file is the partial result of an earlier failed or aborted transfer. To do this, the Zmodem components at each end calculate a Cyclic Redundancy Check on the entire contents of the local file and compare it to a CRC generated on the same number of bytes in the host file. If the CRCs match, Zmodem transfers only the remainder of the file, appending it to the existing local file.

True if CrashRecovery enabled, False if not. Read-write.

Syntax

object.CrashRecovery

Element	Description
object	The FileTransferScheme object.
Comments

Although this feature exists primarily to recover from failed transfers, it is often used to save time when receiving a host file in which data is being added to the end. With CrashRecovery enabled, only the recently-added portion needs to be transferred.


CreatePath Property

Applies To Object

FileTransferScheme

Description

Selects how to handle the directory information of the transferring file. If true and the directories for a received file do not exist, the necessary directories will be created. Read-write.

Syntax

object.CreatePath

Element	Description
object	The FileTransferScheme object.
Comments

Not available if you use ASCII or Xmodem protocol.


Cursor Property

Applies To Object

Session

Description

Returns the Cursor object. Read-only.

Syntax

Set rc = object.Cursor

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned Cursor object.
Object	The Session object.


CursorKeyModeApplication Property

Applies To Object

HostOptions

Description

Sets the mode of the cursor (ARROW) keys so they send application control functions, or ANSI cursor control sequences (default). Or returns the status -- True if application controls, False if ANSI control sequences. Read-write.

Syntax

object.CursorKeyModeApplication

Element	Description
object	The HostOptions object.


CustomPrimaryDA Property

Applies To Object

HostOptions

Description

Returns or sets the terminal's Primary DA (Device Attributes) response string. If the DAResponse property is set to xDAReqCustom, the terminal will send this string in response to a Primary Device Attributes request from the host. You can set up to 31 characters.

Syntax

object.CustomPrimaryDA

Element	Description
object	The HostOptions object.
Comments

Specify control codes in the range 0 to 31 as a circumflex ^ followed by a character. You also enter any special code as a circumflex followed by three decimal numbers.


CustomSecondaryDA Property

Applies To Object

HostOptions

Description

Returns or sets the terminal's Secondary DA (Device Attributes) response string. If the DAResponse property is set to xDAReqCustom, the terminal will send this string in response to a Secondary Device Attributes request from the host. You can set up to 31 characters.

Syntax

object.CustomSecondaryDA

Element	Description
object	The HostOptions object.
Comments

Specify control codes in the range 0 to 31 as a circumflex ^ followed by a character. You also enter any special code as a circumflex followed by three decimal numbers.


DAResponse Property

Applies To Object

HostOptions

Description

Selects or returns the terminal's DA (Device Attributes) response. KEA! sends this response on a request from the host system. Read-write.

Syntax

object.DAResponse

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the DA_RESPONSE enumeration set.


DisplayControls Property

Applies To Object

HostOptions

Description

Sets or returns the status of the Display Controls feature. If true, received control characters are displayed, and not processed . If false, control characters are processed in the normal way . Read-write.

Syntax

object.DisplayControls

Element	Description
object	The HostOptions object.


DuplicateName Property

Applies To Object

FileTransferScheme

Description

Returns or sets the way KEA! handles incoming files that have the same name as another file in the target directory. Read-write.

Syntax

object.DuplicateName

Element	Description
object	The FileTransferScheme object.
Comments

The values set or returned are from the DUPLICATE_FILE enumeration set.

Not available if you are using the ASCII protocol.


EditEOBChars Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Returns or sets the characters sent indicating the end of a block of data. The default character is FF (^L). Read-write.

Syntax

object.EditEOBChars

Element	Description
object	The HostOptions object.


EditEOLChars Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Returns or sets the characters sent indicating the end of a line in a block of data. The default character is CR (^M). Read-write.

Syntax

object.EditEOLChars

Element	Description
object	The HostOptions object.


EditEraseAll Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Sets or returns the type of characters you or the host can erase. If true, protected and unprotected can be erased. If false, unprotected only. Read-write.

Syntax

object.EditEraseAll

Element	Description
object	The HostOptions object.


EditFunctionKeys Property

Applies To Object

HostOptions

Description

Returns or sets how the F6 through F20 function keys work in the DEC Local Edit mode. Read-write.

Syntax

object.EditFunctionKeys

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the EDIT_FNKEYS enumeration set.


EditGuardedAreaAll Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Sets or returns the type of characters to send. If true, send protected and unprotected. If false, send unprotected only. Read-write.

Syntax

object.EditGuardedAreaAll

Element	Description
object	The HostOptions object.


EditKeyImmediate Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Sets or returns how KEA! should switch modes when SHIFT+SELECT is pressed. If true, switch immediately. If false, send request to the host to switch modes. Read-write.

Syntax

object.EditKeyImmediate

Element	Description
object	The HostOptions object.


EditLineTransmit Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Sets or returns the effect of pressing the TRANSMIT key. If true, the TRANSMIT key sends a line of eligible characters. If false, the TRANSMIT key sends a full or partial page. Read-write.

Syntax

object.EditLineTransmit

Element	Description
object	The HostOptions object.
Comments

The page size depends on the EditTransferTermination property and the EditVT131Transfer property.


EditMode Property

Applies To Object

HostOptions

Description

Returns or sets the state of DEC Local Edit mode. Read-write.

Syntax

object.EditMode

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the EDIT_MODE enumeration set.


EditMultipleArea Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Sets or returns which selected area should be sent. If true, send all selected areas on the current page. If false, send only the selected area containing the cursor. Read-write.

Syntax

object.EditMultipleArea

Element	Description
object	The HostOptions object.


EditNewLineScrolling Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Sets or returns the status of the New Line Scrolling feature. If true, scroll at the end of the screen when in line transmit mode. Read-write.

Syntax

object.EditNewLineScrolling

Element	Description
object	The HostOptions object.


EditpadVTLike Property

Applies To Object

HostOptions

Description

Selects whether to force a VT-like arrangement of the six editing keys, or let the driver determine whether the layout is VT-like or PC-like. Or returns the status -- True forces VT-like, False all applications use the setting determined by the driver -- either VT-like or PC-like. Read-write.

Syntax

object.EditpadVTLike

Element	Description
object	The HostOptions object.


EditSelectedAreaAll Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Sets or returns which characters should be sent. If true, sends all characters on the current page. If false, sends only selected characters. Read-write.

Syntax

object.EditSelectedAreaAll

Element	Description
object	The HostOptions object.
Comments

Selected characters are those to which the host assigned the selected attribute; this is similar to the protected attribute.


EditSpaceCompression Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Sets or returns the status of the Space Compression feature. If true, send a record separator in place of unused character fields and spaces in a data block; the last field on a line contains an EOL character. If false, send a space character for each unused character position. Read-write.

Syntax

object.EditSpaceCompression

Element	Description
object	The HostOptions object.


EditTransferTermination Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Sets or returns what is sent when TRANSMIT is pressed. If true, send the scrolling region. If false, send a block based on the EditVT131Transfer property . Read-write.

Syntax

object.EditTransferTermination

Element	Description
object	The HostOptions object.


EditTransmitImmediate Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Sets or returns how KEA! should send data to the host when TRANSMIT is pressed. If true, send data immediately. If false, send ESC S to notify the host that data is available; the host then may send ESC 5 to retrieve the data. Read-write.

Syntax

object.EditTransmitImmediate

Element	Description
object	The HostOptions object.


EditVT131Transfer Property

Applies To Object

HostOptions

Description

This property affects the DEC Local Edit mode.

Sets or returns the terminal type to use when sending a data block. If true, use VT131. If false, use ANSI. Read-write.

Syntax

object.EditVT131Transfer

Element	Description
object	The HostOptions object.


Enabled Property

Applies To Objects

AreaWait

CursorWait

DisconnectWait

FileTransferWait

KeyWait

MacroWait

MatchWait

Wait

Waits

Description

A read-write property of all wait-type objects, including the Waits collection. Setting this property of the Waits collection sets the property for all contained wait-type objects.

When the Enabled property is set to False, the Changed property returns False. For the KeyWait object, queued keystrokes are removed from the queue. If the Process parameter was set to False when WaitForKeys was used to create the object, the de-queued keystrokes are processed normally.

When the Enabled property is set to True again, the Changed property may return True for the following wait-type objects:

CursorWait created by the WaitForCursor method,
DisconnectWait,
FileTransferWait,
MacroWait,
MatchWait created by the WaitForString method.

For other wait-type objects the Changed property will return False until an event occurs. For the MatchWait object created by the WaitHostQuiet method the idle timer is restarted.

Syntax

object.Enabled

Element	Description
object	Any of the above-listed objects.
Comments

When any wait-type object is created, the Enabled property defaults to true. Because a wait-type object starts its monitoring from the moment it is created, it may affect the emulation in undesirable ways. For example, a newly-created KeyWait object starts trapping keystrokes immediately, before a Wait method can be called.

If an object is in a Waits collection, an attempt to change the Enabled property of the wait-type object has no effect.

Calling Wait() with no explicit and no default timeout on a wait-type object whose Enabled property is set to False, or has had the Clear method called on it will cause a "hang" (will wait forever).


EndState Property

Applies To Object

FileTransferResult

Description

Returns the result of one file transferred using single or multiple file transfer. Read-only.

Syntax

object.EndState

Element	Description
object	The FileTransferResult object.
Comments

The returned values are from the FILE_RESULT enumeration set.

Example

 Example


Errors Property

Applies To Object

FileTransferResult

Description

Returns the number of errors during a file transfer as a number. Read-only.

Syntax

object.Errors

Element	Description
object	The FileTransferResult object.
Example

 Example


F1Key Property

Applies To Object

HostOptions

Description

Returns or sets the action the F1 key performs when pressed. Read-write.

Syntax

object.F1Key

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the FUNCTION_KEY enumeration set.


F2Key Property

Applies To Object

HostOptions

Description

Returns or sets the action the F2 key performs when pressed. Read-write.

Syntax

object.F2Key

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the FUNCTION_KEY enumeration set.


F3Key Property

Applies To Object

HostOptions

Description

Returns or sets the action the F3 key performs when pressed. Read-write.

Syntax

object.F3Key

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the FUNCTION_KEY enumeration set.


F4Key Property

Applies To Object

HostOptions

Description

Returns or sets the action the F4 key performs when pressed. Read-write.

Syntax

object.F4Key

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the FUNCTION_KEY enumeration set.


F5Key Property

Applies To Object

HostOptions

Description

Returns or sets the action the F5 key performs when pressed. Read-write.

Syntax

object.F5Key

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the FUNCTION_KEY enumeration set.


FileEnd Property

Applies To Object

FileTransferWait

Description

Returns the result of the file transfer as a whole. Read-only.

Syntax

object.FileEnd

Element	Description
object	The FileTransferWait object.
Comments

The returned values are from the FILE_RESULT enumeration set.

FileEnd is the default Property of the FileTransferWait object.

Reading the FileEnd property before the file transfer has completed causes an implicit call to the Wait method.

Example

 Example


FileTransferScheme Property

Applies To Object

Session

Description

Returns the FileTransferScheme object. Read-only.

Syntax

Set rc = object.FileTransferScheme

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned FileTransferScheme object.
object	The Session object.


FileType Property

Applies To Object

FileTransferScheme

Description

Whether to send files in automatic, binary, or text mode. Read-write.

Syntax

object.FileType

Element	Description
object	The FileTransferScheme object.
Comments

The values set or returned are from the FILE_TYPE enumeration set.


Font Property

Applies To Object

Session

Description

Returns the Font object. Read-only.

Syntax

Set rc = object.Font

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned Font object.
object	The Session object.


FullName Property

Applies To Objects

Session

System

Description

Used with a Session object, this property returns the path and filename of the session. Read-only.

Used with a System object, this property returns the path and filename of the KEA! OLE Automation server. Read-only.

Syntax

object.FullName

Element	Description
object	The Session object, or the System object.
Example

 Example


GraphicsBitmap Property

Applies To Object

HostOptions

Description

Sets or returns how KEA! stores the graphics image for printing and redrawing on the screen. If true, a copy of the image is saved in memory; however, if you change the font size, the image cannot be redisplayed. Read-write. Default is false.

Syntax

object.GraphicsBitmap

Element	Description
object	The HostOptions object.
Comments

See also the GraphicsDisplayList property. If you select both properties, Display List is used when necessary (for example, after a zoom), and Bitmap is used at other times. To print an image, at least one of these properties must be selected.


GraphicsCursor Property

Applies To Object

HostOptions

Description

Sets or returns the status of the graphics cursor. If true, an output cursor appears at the writing point. Read-write.

Syntax

object.GraphicsCursor

Element	Description
object	The HostOptions object.
Comments

This does not affect the Graphics Input Mode cursor.


GraphicsDisplayList Property

Applies To Object

HostOptions

Description

Sets or returns how KEA! stores the graphics image for printing and redrawing on the screen. If true, (default) all the graphics commands are stored in a list. This provides the most flexibility when you want to change the font size (zoom) and when printing. Read-write.

Syntax

object.GraphicsDisplayList

Element	Description
object	The HostOptions object.
Comments

See also the GraphicsBitmap property. If you select both properties, Display List is used when necessary (for example, after a zoom), and Bitmap is used at other times. To print an image, at least one of these properties must be selected.


GraphicsMacroReport Property

Applies To Object

HostOptions

Description

If true, KEA! sends the contents of a macrograph in response to a ReGIS Report Macrograph command from the host. Read-write.

Syntax

object.GraphicsMacroReport

Element	Description
object	The HostOptions object.


Height Property

Applies To Object

Session

Description

Returns or sets the height of the session window in pixels. Read-write.

Syntax

object.Height

Element	Description
object	The Session object.
Example

 Example


History Property

Applies To Object

Session

Description

Sets or returns the status of the History feature. If true, data no longer displayed in the emulation window is stored in the History buffer. Read-write.

Syntax

object.History

Element	Description
object	The Session object.


HorizontalCoupling Property

Applies To Object

HostOptions

Description

Sets or returns the status of the Horizontal Coupling feature. If true, the terminal will scroll horizontally to keep the cursor visible when the cursor moves beyond the right or left edge of a window. Read-write.

Syntax

object.HorizontalCoupling

Element	Description
object	The HostOptions object.


HostName Property

Applies To Objects

Screen

SerialOptions

Description

Returns the name of the host to which you are connected as a string. Read-only.

Syntax

object.HostName

Element	Description
object	The Screen object or the SerialOptions object.
Comments

HostName is the default Property of the Screen object and the SerialOptions object.

Example

 Example


HostOptions Property

Applies To Object

Screen

Description

Returns the HostOptions object. Read-only.

Syntax

Set rc = object.HostOptions

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned HostOptions object.
object	The Screen object.


hWnd Property

Applies To Object

Session

Description

Returns a handle to the KEA! main window. Read-only.

Syntax

object.hWnd

Element	Description
object	The Session object.
Comments

Use this property with caution.


InverseScreen Property

Applies To Object

HostOptions

Description

Sets or returns the status of the Inverse Screen feature. If true, the foreground and background colors are reversed for normal text. Read-write.

Syntax

object.InverseScreen

Element	Description
object	The HostOptions object.


KeyboardLayout Property

Applies To Object

HostOptions

Description

Returns or sets the keyboard type: Enhanced, PowerStation, LK250, or LK450. Read-write.

Syntax

object.KeyboardLayout

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the KEYBOARD_LAYOUT enumeration set.


KeypadModeApplication Property

Applies To Object

HostOptions

Description

Sets the mode of the keypad keys so they send application control sequences, or the ASCII code of the numbers shown on the keycaps (default). Or returns the status -- True if application controls, False if ASCII codes. Read-write.

Syntax

object.KeypadModeApplication

Element	Description
object	The HostOptions object.


Left Property

Applies To Objects

Area

Session

Description

Used with an Area object, the Left property returns or sets the screen column where the area begins as a number. Read-write.

Used with a Session object, it returns or sets the position of the left edge of the window as a number. Read-write.

Syntax

object.Left

Element	Description
object	The Area object or the Session object.
Examples

 Example

 Example


Lines Property

Applies To Object

HostOptions

Description

Returns or sets (as a string) the number of lines per page for the session. You can enter any number of lines between 24 and 144. Read-write.

Setting the number of lines also sets the number of pages. The following numbers are compatible with DIGITAL VT terminals: 24 (6 pages), 25 (5 pages), 36 (4 pages), 48 (3 pages), 72 (2 pages), and 144 (1 page).

Syntax

object.Lines

Element	Description
object	The HostOptions object.


Local Property

Applies To Object

Screen

Description

Sets or returns the status of the Local feature. If true, KEA! sends data you enter from the keyboard to the screen, but not to the host. In this mode, data received from the host is buffered until you return the terminal to the on-line state by setting this property to False.

Syntax

object.Local

Element	Description
object	The Screen object.


LocalEcho Property

Applies To Object

HostOptions

Description

Sets or returns the status of the Local Echo feature. If true, the terminal displays characters as it sends them to the host. If false, the terminal lets the host handle echo. Read-write.

Syntax

object.LocalEcho

Element	Description
object	The HostOptions object.


LockUserFeatures Property

Applies To Object

HostOptions

Description

Sets or returns the status of the Lock User Features option. If true, the host system is prevented from changing the settings of the user preference features columns, scroll, and inverse screen. Read-write.

Syntax

object.LockUserFeatures

Element	Description
object	The HostOptions object.


LockUserKeys Property

Applies To Object

HostOptions

Description

Sets or returns the status of the Lock User Keys option. If true, the host system is prevented from changing the user-defined key (UDK) definitions. Read-write.

Syntax

object.LockUserKeys

Element	Description
object	The HostOptions object.


MacroEnd Property

Applies To Object

MacroWait

Description

Returns the result of one or more KEA! macro-language commands. Read-only.

Syntax

object.MacroEnd

Element	Description
object	The MacroWait object.
Comments

The returned values are from the MACRO_RESULT enumeration set.

MacroEnd is the default Property of the MacroWait object.

Reading the MacroEnd property before the macro has completed causes an implicit call to the Wait method.

Example

 Example


MarginBell Property

Applies To Object

HostOptions

Description

Sets the margin bell to sound when the text cursor approaches the right margin, or returns its status -- True if the bell is enabled, False if not. Read-write.

Syntax

object.MarginBell

Element	Description
object	The HostOptions object.


Menu Property

Applies To Object

Session

Description

Sets or returns the status of the KEA! menu bar. If true, the menu bar is displayed. If false, the menu bar is hidden. Read-write.

Syntax

object.Menu

Element	Description
object	The Session object.


Name Property

Applies To Objects

FileTransferResult

KeyWait

Session

System

Description

Used with a FileTransferResult object, the Name property returns the local filename as a string. Read-only.

Used with a KeyWait object, it returns the name of the keystroke as a string. Read-only.

Used with a Session or System object, it returns the product name as a string. Read-only.

Syntax

object.Name

Element	Description
object	Any of the above objects.
Comments

Name is the default Property of the FileTransferResult, KeyWait, and Session objects.

Reading the Name property causes an implicit call to the Wait method for the KeyWait object if an event has not occurred since the object was created or since the last call to Reset.

Examples

 Example

 Example

 Example


NationalCharacterSet Property

Applies To Object

HostOptions

Description

Selects or returns the terminal's National Replacement Character Set. This is the character set used when the CharacterSetMode property is set to xCSMNational. Read-write.

Syntax

object.NationalCharacterSet

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the NATIONAL_CHARSET enumeration set.


NewLine Property

Applies To Object

HostOptions

Description

Sets or returns the status of the New Line feature. If true, the ENTER key sends a CR and LF. If false, the ENTER key sends just a CR. Read-write.

Syntax

object.NewLine

Element	Description
object	The HostOptions object.


Options Property

Applies To Object

Connectivity

Description

Returns the SerialOptions object. Read-only.

Syntax

Set rc = object.ActiveSession

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned SerialOptions object.
object	The Connectivity object.


Page Property

Applies To Objects

Area

CursorWait

MatchWait

Screen

Description

Applied to an Area object, this property sets or returns the page where the object is defined. Read-write

Applied to a CursorWait, MatchWait or Screen object, this property returns the page position of the cursor. Read-only

Syntax

object.Page

Element	Description
object	Any of the above-listed objects..
Comments

An Area object cannot span multiple pages.

Reading the Page property causes an implicit call to the Wait method for the following objects if an event has not occurred since the object was created or since the last call to Reset:

CursorWait created by the WaitForCursorMove method,
MatchWait created by the WaitForStream or WaitHostQuiet methods.

Examples

 Example

 Example


PageCoupling Property

Applies To Object

HostOptions

Description

Sets or returns the status of the Page Coupling feature. If true, the terminal will automatically display a different page to keep the cursor visible when the cursor moves to that page in page memory. Read-write.

Syntax

object.PageCoupling

Element	Description
object	The HostOptions object.


Pages Property

Applies To Object

Screen

Description

Returns the number of pages available (not including status line). Read-only.

Syntax

object.Pages

Element	Description
object	The Screen object.


Parent Property

Applies To Objects

Area

AreaWait

Button

Buttons

Connectivity

CursorWait

DisconnectWait

FileTransferScheme

FileTransferWait

Font

HostOptions

KeyWait

MacroWait

MatchWait

Screen

SerialOptions

Session

Sessions

System

Wait

Description

For objects contained in a collection, the Parent property returns the collection object. For wait-type objects not in a collection, the Parent property returns NULL. For other objects, the Parent property returns the object through which it was obtained. And for some other objects, it returns the System object.

Syntax

Set rc = object.Parent

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned object.
object	One of the above-listed objects.
Comments

The following table lists the parent of each object.

Object	Parent
Area	Screen
AreaWait	Waits
Button	Buttons
Buttons	Session
Connectivity	Session
CursorWait	Waits
DisconnectWait	Waits
FileTransferScheme	Session
FileTransferWait	Waits
Font	Session
HostOptions	Screen
KeyWait	Waits
MacroWait	Waits
MatchWait	Waits
Screen	Session
SerialOptions	Connectivity
Session	System
Sessions	System
System	System
Wait	Waits


Path Property

Applies To Object

Session

Description

This property returns the path of the session file (.KTC file). The filename is not included. Read-only.

Syntax

object.Path

Element	Description
object	The Session object.
Example

 Example


PrintAutoFontSelect Property

Applies To Object

HostOptions

Description

Sets or returns the status of the font auto-select feature. If true, uses the fixed-pitch font that best fits 80 or 132 columns on the printed page. If false, the font is determined by the PrintFont, PrintFontSize, and PrintFontStyle properties. Read-write.

Syntax

object.PrintAutoFontSelect

Element	Description
object	The HostOptions object.
Comments

The font is selected from those supplied by the printer driver.


PrintBackground Property

Applies To Object

HostOptions

Description

This property affects the printing of graphics images.

Sets or returns the status of the background feature. If true, Print the current screen background. If false, the background does not print (default). Read-write.

Syntax

object.PrintBackground

Element	Description
object	The HostOptions object.


PrintCloseIdle Property

Applies To Object

HostOptions

Description

Returns or sets the interval of idle time (no data received) after which any buffered printer data is flushed, and the page is printed. This property handles the timing needs of local and network printers. It affects all modes of printing: print screen, auto print, and printer controller modes. Read-write.

Syntax

object.PrintCloseIdle

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the PRINT_CLOSEIDLE enumeration set.


PrintColors Property

Applies To Object

HostOptions

Description

This property affects the printing of graphics images.

Sets or returns the status of the print colors feature. If true, prints colors on a color printer, and uses a dithering technique on a monochrome printer; the dithering technique depends on the driver's support. If false, all non-white colors are converted to black. Read-write.

Syntax

object.PrintColors

Element	Description
object	The HostOptions object.


PrintEmulateANSI Property

Applies To Object

HostOptions

Description

Sets or returns the status of the emulate ANSI feature in Printer Controller mode. If true, KEA! assumes the host sends LA210 ANSI printer sequences and translates them to equivalent Windows printer functions. If false, KEA! assumes the host is configured for the specific printer attached and sends all data to the printer without translation. Read-write.

Syntax

object.PrintEmulateANSI

Element	Description
object	The HostOptions object.


PrintExtent Property

Applies To Object

HostOptions

Description

Returns or sets how much of the VT page to print when you request a print screen by pressing a key. The VT terminal defines the extent. Read-write.

Syntax

object.PrintExtent

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the PRINTER_EXTENT enumeration set.

The host can control this option.

The Print method controls its own extent. Along with Page, it offers All Pages, Selection, and Window (the current view), which you cannot choose in this property.


PrintFont Property

Applies To Object

HostOptions

Description

Returns or sets the font you want to use for printing. Supply a string from the list of your installed Windows fonts. Read-write.

Syntax

object.PrintFontProperty

Element	Description
object	The HostOptions object.
Comments

Has no effect if the PrintAutoFontSelect property is enabled.


PrintFontSize Property

Applies To Object

HostOptions

Description

Returns or sets the font size (as a string) you want to use for printing. Read-write.

Syntax

object.PrintFontSize

Element	Description
object	The HostOptions object.
Comments

Has no effect if the PrintAutoFontSelect property is enabled.


PrintFontStyle Property

Applies To Object

HostOptions

Description

Returns or sets the font style (as a string) you want to use for printing. Select from Regular, Italic, Bold, or Bold Italic. Read-write.

Syntax

object.PrintFontStyle

Element	Description
object	The HostOptions object.
Comments

Has no effect if the PrintAutoFontSelect property is enabled.


PrintMode Property

Applies To Object

HostOptions

Description

Returns or sets when and how printing occurs. Read-write.

Syntax

object.PrintMode

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the PRINT_MODE enumeration set.

In most cases, the host selects these modes for you.


PrintReverseBlackWhite Property

Applies To Object

HostOptions

Description

This property affects the printing of graphics images.

Sets or returns the status of the print reverse feature. If true, swaps the brightest and darkest color in the palette for printing. Usually, this prints the image on a white background (because paper is white, and the screen usually is black). Read-write.

Syntax

object.PrintReverseBlackWhite

Element	Description
object	The HostOptions object.


PrintTerminator Property

Applies To Object

HostOptions

Description

Controls whether a form feed is sent at the end of the print operation. If true, KEA! sends a form feed forcing each print to a separate page. If false, sends no form feed. Read-write.

Syntax

object.PrintTerminator

Element	Description
object	The HostOptions object.


PrintUseBitmap Property

Applies To Object

HostOptions

Description

This property affects the printing of graphics images.

Sets or returns the status of the backing store feature. If true, use the bitmap method of graphics printing, regardless of which backing store method was selected in the GraphicsBitmap and the GraphicsDisplayList properties. Read-write.

Syntax

object.PrintUseBitmap

Element	Description
object	The HostOptions object.


Protocol Property

Applies To Object

FileTransferScheme

Description

Returns or sets the protocol to use for file transfers. Read-write.

Syntax

object.Protocol

Element	Description
object	The FileTransferScheme object.
Comments

The values set or returned are from the FILE_PROTOCOL enumeration set.


Quiet Property

Applies To Object

FileTransferScheme

Description

Sets or returns the status of the quiet transfer feature. If true, status is not shown during a file transfer. Read-write.

Syntax

object.Quiet

Element	Description
object	The FileTransferScheme object.


ReceiveTo Property

Applies To Object

FileTransferScheme

Description

Selects how to handle the directory information of the transferring file. This property returns or sets the starting path from which the destination path is created. When the UsePath property is enabled, the path supplied by the host will be appended to this path. When no path is supplied by the host or when the UsePath property is disabled, the received files are placed in this directory. Read-write.

Syntax

object.ReceiveTo

Element	Description
object	The FileTransferScheme object.
Comments

Not available if you use ASCII or Xmodem protocol.


RecurseSubdirectories Property

Applies To Object

FileTransferScheme

Description

Selects how to handle the directory information of the transferring file. If true the current directory's subdirectories will be searched to transfer files that match the given filename or pattern. Read-write.

Syntax

object.RecurseSubdirectories

Element	Description
object	The FileTransferScheme object.
Comments

Not available if you use ASCII or Xmodem protocol.


RemoteName Property

Applies To Object

FileTransferResult

Description

Returns the name of file as sent to host or as received from host. Read-only.

Syntax

object.RemoteName

Element	Description
object	The FileTransferResult object.
Example

 Example


Right Property

Applies To Object

Area

Description

Returns or sets the screen column number where the area ends. Read-write.

Syntax

object.Right

Element	Description
object	The Area object.
Example

 Example


Row Property

Applies To Objects

CursorWait

MatchWait

Screen

Description

Returns the cursor row or the row of matched text as a number. Read-only.

Syntax

object.Row

Element	Description
object	Any of the above-listed objects.
Comments

Reading the Row property will result in an implicit call to the Wait method for the following objects if an event has not occurred since the object was created or since the last call to Reset:

CursorWait created by the WaitForCursorMove method,

MatchWait created by the WaitForStream or WaitHostQuiet methods.

Example

 Example


Rows Property

Applies To Object

Screen

Description

Returns the number of rows per page. Read-only.

Syntax

object.Rows

Element	Description
object	The Screen object.
Example

 Example


Saved Property

Applies To Object

Session

Description

Returns the save status of the session -- True if the session has been saved since it was last modified, False if not. Read-only.

Syntax

object.Saved

Element	Description
object	The Session object.
Example

 Example


ScanUnknownType Property

Applies To Object

FileTransferScheme

Description

Sets or returns the status of the Scan Unknown File For Type feature. If true, before KEA! sends a file, it reads a portion of the file, determines if it contains any 8-bit or control codes, and if it does, sends the file as a Binary type. Read-write.

This feature is activated only if the FileType property is set to xFileTypeAutomatic.

Syntax

object.ScanUnknownType

Element	Description
object	The FileTransferScheme object.


Screen Property

Applies To Object

Session

Description

Returns the Screen object associated with the session.

Syntax

Set rc = object.Screen

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned Screen object.
object	The Session object.
Example

 Example


Scroll Property

Applies To Object

HostOptions

Description

Returns or sets the scrolling mode. When the cursor reaches the end of a page, each new line received from the host can cause the previously received lines to scroll upwards. Because this requires all the text in the emulation window to be re-written in a different position, data that is arriving too fast may have to wait while a slow machine repeatedly moves lines of text. To avoid waiting for KEA! to display every line as soon as it arrives, select xScrollJump2 or xScrollJump4. No data is lost, only the line-by-line scrolling is omitted to save time. Whenever KEA! catches up to the incoming data, it re-writes the window to show the most recently received text. Read-write.

Syntax

object.Scroll

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the SCROLL_MODE enumeration set.


Selection Property

Applies To Object

Screen

Description

Returns an Area object representing the area of the screen currently selected by the user. Read-only.

Syntax

Set rc = object.Selection

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
Rc	The returned Area object.
Object	The Screen object.
Example

 Example


SendFullPath Property

Applies To Object

FileTransferScheme

Description

Selects how to handle the directory information of the transferring file. If true the file's complete path information will be sent. Read-write. See also the RecurseSubdirectories property.

Syntax

object.SendFullPath

Element	Description
object	The FileTransferScheme object.
Comments

Not available if you use ASCII or Xmodem protocol.


Sessions Property

Applies To Object

System

Description

Returns the Sessions collection containing the individual Session objects that are currently open. Read-only.

Syntax

Set rc = object.Sessions

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned Sessions collection.
object	The System object.
Comments

If no sessions are opened, the object is still returned, but its Count property is 0.

Example

 Example


SixelBackgroundPrinting Property

Applies To Object

HostOptions

Description

This property affects how KEA! sends the current image, in sixel format, to the host when the host issues a ReGIS hardcopy command S(H). If true, KEA! sends background colors. Read-write.

Syntax

object.SixelBackgroundPrinting

Element	Description
object	The HostOptions object.


SixelColorPrinting Property

Applies To Object

HostOptions

Description

This property affects how KEA! sends the current image, in sixel format, to the host when the host issues a ReGIS hardcopy command S(H). If true, KEA! sends color sixels. If false, monochrome sixels. Read-write.

Syntax

object.SixelColorPrinting

Element	Description
object	The HostOptions object.


SixelColorSpecification Property

Applies To Object

HostOptions

Description

This property affects how KEA! sends the current image, in sixel format, to the host when the host issues a ReGIS hardcopy command S(H). It returns or sets a color-encoding method: HLS (Hue, Lightness, and Saturation) or RGB. The default is HLS. Read-write.

Syntax

object.SixelColorSpecification

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the COLOR_SPEC enumeration set.


SixelGraphicsLevel Property

Applies To Object

HostOptions

Description

This property affects how KEA! sends the current image, in sixel format, to the host when the host issues a ReGIS hardcopy command S(H). It selects the aspect ratio of the sixel data sent to the host. Select the option that best matches the VAX printer on which you will print the image.

Syntax

object.SixelGraphicsLevel

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the SIXEL_LEVEL enumeration set.


SixelIgnorePrintRequests Property

Applies To Object

HostOptions

Description

This property affects how KEA! responds to a host's ReGIS hardcopy command S(H). If true, the request is ignored. Read-write.

Syntax

object.SixelIgnorePrintRequests

Element	Description
object	The HostOptions object.


SixelPrintOption Property

Applies To Object

HostOptions

Description

This property affects how KEA! sends the current image, in sixel format, to the host when the host issues a ReGIS hardcopy command S(H). It sets the size of the sixel image.

Syntax

object.SixelPrintOption

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the SIXEL_PRINT enumeration set.


SixelScrolling Property

Applies To Object

HostOptions

Description

Sets or returns the status of the sixel scrolling feature. If true, sixel drawing begins at the current text cursor position, and can scroll the screen. If false, sixel drawing begins at the home position, and cannot scroll the screen. This does not affect the text active position. Read-write.

Syntax

object.SixelScrolling

Element	Description
object	The HostOptions object.
Comments

For VT340 compatibility enable this property; for VT240 compatibility do not enable.


Size Property

Applies To Objects

FileTransferResult

Font

Description

Used with a FileTransferResult object, the Size property returns the size of the file. Read-only.

Used with a Font object, it returns or sets the width of the font as a number. Read-write.

Syntax

object.Size

Element	Description
object	The FileTransferResult or Font object.
Example

 Example


StatusBar Property

Applies To Object

Session

Description

Returns the contents of the status bar as a string. Read-only.

Syntax

object.StatusBar

Element	Description
object	The Session object.


StatusDisplay Property

Applies To Object

HostOptions

Description

Returns or sets how the VT status line is used: not at all, Indicator, or Host. Read-write.

Syntax

object.StatusDisplay

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the STATUS_DISPLAY enumeration set.


String Property

Applies To Object

MatchWait

Description

Returns the matched string (or "1" if the match is an empty string) if successful otherwise returns an empty string. Read-only.

Syntax

object.String

Element	Description
object	The MatchWait object.
Comments

String is the default Property of the MatchWait object.

Reading the String property causes an implicit call to the Wait method for the MatchWait object created by the WaitForStream or WaitHostQuiet methods if an event has not occurred since the object was created or since the last call to Reset.


StyledLines Property

Applies To Object

HostOptions

Description

Sets or returns the way KEA! draws styled lines (lines with a dash/dot pattern). If true, a solid background, rather than a transparent background, is used. Read-write.

Syntax

object.StyledLines

Element	Description
object	The HostOptions object.
Comments

Many Windows video drivers do not support styled lines properly on a transparent background. Sometimes, these styled lines do not display. If your image is missing some lines, try this property. Although this differs from what the VT340 does, it displays the styled lines properly.


Synchronous Property

Applies To Object

Screen

Description

Enables/disables asynchronous processing when a wait-type object has been created. If this option is true and a wait-type object exists processing inside KEA! is suspended except:

during a call to Wait()

when a call to Wait() is implied

for a very short time during a read of the Changed property.

Syntax

object.Synchronous

Element	Description
object	The Screen object.
Comments

Disabling the processing inside KEA! means that host input is not accepted. The state of the screen remains unchanged until Synchronous is changed to False or a Wait is issued or Changed read.

This may be needed if the client program must send data to the host (e.g. enter a command) and establish a number of wait conditions and be ready to watch for them before the host responds. To be sure that the host can't respond before the client is ready, you can set Synchronous to True.

If you set Synchronous to True be sure to set it back to False when you want normal emulation processing to occur. In general you will use a pair of screen.Sychronous = True and screen.Synchronous = False statements around a section of code that must be in control of the processing of host data.

Examples

 Example

 Example


TektronixAutoPrint Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Sets or returns the status of the auto print feature. If true, the terminal produces a hardcopy each time the Page Full Condition occurs. If false, it does not produce a hardcopy (default). Read-write.

Syntax

object.TektronixAutoPrint

Element	Description
object	The HostOptions object.
Comments

The screen clears when the hardcopy finishes printing.


TektronixBSDoesDEL Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Sets or returns the status of backspace processing. If true, when an ASCII BS is received the terminal backspaces the cursor and erases the character. If false, backspace only. Read-write.

Syntax

object.TektronixBSDoesDEL

Element	Description
object	The HostOptions object.


TektronixCharacterSet Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Returns or sets the character set to use. Read-write.

Syntax

object.TektronixCharacterSet

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the TEK_CHARSET enumeration set.


TektronixCRAddsLF Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Sets or returns the status of the CR Effect. If true, when a CR is received, the cursor moves to current margin, then down one line. If false, the cursor moves to current margin (default). Read-write.

Syntax

object.TektronixCRAddsLF

Element	Description
object	The HostOptions object.


TektronixDELIgnored Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Sets or returns the status of the DEL Effect. If true, KEA! ignores received DEL codes. If false, a DEL is processed the same as any other received character. Read-write.

Syntax

object.TektronixDELIgnored

Element	Description
object	The HostOptions object.
Comments

Use this property if your host sends DEL as a pad character.


TektronixDisplay Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Returns or sets the size of the emulation screen used to display the Tektronix image. Read-write.

Syntax

object.TektronixDisplay

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the TEK_DISPLAY enumeration set.


TektronixEnlargedCharacters Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Sets or returns the size of displayed characters. If true, uses enlarged, easy-to-read characters. If false, uses 4014 character sizes (Default). Read-write.

Syntax

object.TektronixEnlargedCharacters

Element	Description
object	The HostOptions object.
Comments

The enlarged characters do not align exactly with graphics.


TektronixGINTerminator Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Returns or sets the GIN position report terminator code. Read-write.

Syntax

object.TektronixGINTerminator

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the TEK_GIN enumeration set.


TektronixLFAddsCR Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Sets or returns the status of the LF Effect. If true, when a LF is received, the cursor moves down one line, then to current margin. If false, the cursor moves down one line (default). Read-write.

Syntax

object.TektronixLFAddsCR

Element	Description
object	The HostOptions object.


TektronixLineStyleMap Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Returns or sets the way standard 4014 line styles are mapped to Windows colors. Read-write.

Syntax

object.TektronixLineStyleMap

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the TEK_LINEMAP enumeration set.


TektronixMarginControl Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Returns or sets the circumstances under which Page Full Condition occurs. Read-write.

Syntax

object.TektronixMarginControl

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the TEK_MARGIN enumeration set.

This property is equivalent to the MarginControl switch on a 4014.


TektronixVectorFont Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Sets or returns the type of characters to use. If true, characters are generated from a vector definition of the characters, much like the Tektronix 4010/4014 device. If false, (Default) characters are generated from the built-in bitmap fonts for Tektronix characters. Read-write.

Syntax

object.TektronixVectorFont

Element	Description
object	The HostOptions object.
Comments

In most cases, the false setting provides better looking characters. However, the character sizing may be less accurate than Vector drawn characters.


TektronixVT640Compatible Property

Applies To Object

HostOptions

Description

This property affects the terminal when it is in Tektronix mode.

Sets or returns the status of the VT640 compatibility feature. If true, VT640 sequences for entering and exiting Tektronix mode are accepted. If false, they are ignored . Read-write.

Syntax

object.TektronixVT640Compatible

Element	Description
object	The HostOptions object.


TerminalMode Property

Applies To Object

HostOptions

Description

Returns or sets the terminal operating mode (terminal type) as a string. Read-write.

Syntax

object.TerminalMode

Element	Description
object	The HostOptions object.


TextFiles Property

Applies To Object

FileTransferScheme

Description

Specify the file extensions (as a string) you want to identify as text files. Read-write.

This feature is activated only if the FileType property is set to xFileTypeAutomatic.

Syntax

object.TextFiles

Element	Description
object	The FileTransferScheme object.


Time Property

Applies To Object

FileTransferResult

Description

Returns the amount of time required to transfer the file as a number. Read-only.

Syntax

object.Time

Element	Description
object	The FileTransferResult object.
Example

 Example


Timeouts Property

Applies To Object

FileTransferResult

Description

Returns the number of timeouts encountered during the transfer of the file. Read-only.

Syntax

object.Timeouts

Element	Description
object	The FileTransferResult object.
Example

 Example


Title Property

Applies To Object

Session

Description

Returns the KEA! caption without the "KEA! xxx - " as a string. Read-only.

Syntax

object.Title

Element	Description
object	The Session object.


Top Property

Applies To Objects

Area

Session

Description

Used with an Area object, the Top property returns or sets the row where the area begins. Read-write.

Used with a Session object, it returns or sets the vertical position of the session, in pixels. Read-write.

Syntax

object.Top

Element	Description
object	The Area object or Session object.
Comments

For the Area object, you can set the Top property to shrink or expand the object. For example, if you initially defined an area with a top row of two, you can set the top row to four, thereby shrinking the size of the area. You can also adjust the size of the Area object with the Bottom, Left, and Right properties.

For the Session object, you can set the Top property to change a session window's vertical position on the screen. To change a session window's horizontal position, set the Left property.

Examples

 Example

 Example


Type Property

Applies To Objects

Area

Connectivity

Session

Description

Used with an Area object, the Type property determines how the Area coordinates (top, left, bottom, right) are interpreted. Read-write.

Used with a Connectivity object, it returns the host name as a string. Read-only.

Used with a Session object, it returns the current session type. Read-only.

Syntax

object.Type

Element	Description
object	The Area, Connectivity, or Session object.
Comments

Used with an Area object, the values set or returned are from the AREA_TYPE enumeration set.

Type is the default Property of the Connectivity object.

Used with a Session object, the returned values are from the SESSION_TYPE enumeration set.

Example

 Example


UsePath Property

Applies To Object

FileTransferScheme

Description

Selects how to handle the directory information of the transferring file. If true the file will be stored based on a path supplied by the host, appended to the path specified by the ReceiveTo property. Read-write.

Syntax

object.UsePath

Element	Description
object	The FileTransferScheme object.
Comments

Not available if you use ASCII or Xmodem protocol.


UserPreferredCharacterSet Property

Applies To Object

HostOptions

Description

Returns or sets the 8-bit supplemental character set in use. Read-write.

Syntax

object.UserPreferredCharacterSet

Element	Description
object	The HostOptions object.
Comments

The values set or returned are from the USER_CHARSET enumeration set.


Value Property

Applies To Object

Area

Description

Returns the text from the area described by the object. Read-only.

Syntax

object.Value

Element	Description
object	The Area object.
Comments

Wraps at the end of each row, no terminators.

Value is the default Property of the Area object.

Example

 Example


Version Property

Applies To Object

System

Description

Returns the product version as a string. Read-only.

Syntax

object.Version

Element	Description
object	The System object.
Example

 Example


VerticalCoupling Property

Applies To Object

HostOptions

Description

Sets or returns the status of the Vertical Coupling feature. If true, the terminal will scroll vertically to keep the cursor visible when the cursor moves beyond the top or bottom of a window. Read-write.

Syntax

object.VerticalCoupling

Element	Description
object	The HostOptions object.


Visible Property

Applies To Objects

Cursor

Session

Description

Used with a Cursor object, the Visible property sets or returns the status of the cursor visible feature. If true, the cursor is visible. If false, the cursor is invisible. Read-write.

Used with a Session object, it sets or returns the visibility of the session. If true, the session is visible. If false, the session is hidden. Read-write.

Syntax

object.Visible

Element	Description
object	The Cursor object or Session object.
Comments

By default, a new session does not appear. To make it visible, set the property to True.

If a session is set visible, it will continue to exist even if all objects referencing the session are set to Nothing. If the session is set hidden and all objects referencing the session are set to Nothing, the session will close.

Example

 Example


Waits Property

Applies To Object

System

Description

Returns a new Waits collection that can be used to wait for multiple wait-type objects simultaneously. Read-only.

Syntax

Set rc = object.Waits

Element	Description
Set	The Set statement, required for assigning an object reference to a variable.
rc	The returned Waits collection.
object	The System object.
Example

 Example


WarningBell Property

Applies To Object

HostOptions

Description

Sets or returns the status of the warning bell feature. If true, the warning bell sounds when an operating error occurs or the terminal receives ASCII BEL.  Read-write.

Syntax

object.WarningBell

Element	Description
object	The HostOptions object.


Width Property

Applies To Object

Session

Description

Returns or sets the width of the session window in pixels. Read-write.

Syntax

object.Width

Element	Description
object	The Session object.
Example

 Example


WindowState Property

Applies To Object

Session

Description

Returns or sets the state of the session window -- normal, maximized, or minimized. Read-write.

Syntax

object.WindowState

Element	Description
object	The Session object.
Comments

The values set or returned are from the WINDOW_STATE enumeration set.

Example

 Example


Introduction to Using KEA! with OLE Automation

KEA! supports OLE Automation, a Microsoft Windows standard for inter-program communications. As an OLE Automation server, KEA! exposes programmable objects like Session, Screen, and Button, whose built-in functionality can be accessed by user-written applications. For example, you could write a PC application that transfers files to and from a VAX. You would not have to write the file transfer code, but merely invoke the file transfer functionality inherent in the VT Session object. To access automation-enabled objects, you must use a macro or programming language that supports OLE Automation, such as Microsoft's Visual Basic 3.0 or later.

You control objects through their properties and methods, using the dot syntax of object.property and object.method.  For more information on objects, methods, or properties, choose a topic from the list below.

 Overview of Objects

 Overview of Properties

 Overview of Methods

 Overview of Enumerations

 Setting Up Visual Basic


Overview of Objects

An object is one component of an application like KEA!, which can be controlled through its properties and methods. Some of the KEA! objects are the same as the visual objects that appear when you run KEA! manually, like a session or a button. Other objects cannot be displayed. For example, an Area object, which defines a section of a screen, is not visible.

KEA! consists of the following objects:

System - Top-level object, providing access to all objects in KEA!.

Session - Provides access to host data and KEA! functionality.

Sessions Collection - Manages open session objects.

Screen - Provides access to the contents of the host presentation space, an area in PC memory that stores the screen data of a session.

Area - Provides access to a defined area of the screen.

Host Options - Equivalent to many of the options on KEA!'s Options menu.

Cursor - Changes the appearance of the cursor.

Font - Changes the appearance of the screen font.

Button - Equivalent to one of KEA!'s user-defined buttons.

Buttons Collection - Manages available Button objects.

Connectivity - Equivalent to KEA!'s Communications dialog box.

SerialOptions - Provides access to terminal connectivity options.

FileTransferScheme - Equivalent to KEA!'s File Transfer dialog box

FileTransferResult - Contains information about a single file in a multi-file transfer.

Various wait-type objects - Controls and checks the status of events.

Waits Collection - Controls and checks the status of a number of wait-type objects.

See Also

The Hierarchy Diagram

Creating Objects

Referencing Objects

Collections

Wait-type Objects

Waiting For Several Events

Controlling Changes While Monitoring Events

Removing Objects

Overview of Properties

Overview of Methods

Overview of Enumerations

Setting Up Visual Basic


The Hierarchy Diagram

The shaded objects in the diagram represent entry points into KEA! Objects. Objects pointed to by an arrow are obtained by a method or property belonging to another object.


Creating Objects

There is a hierarchical organization to KEA! objects, which defines the KEA! functionality available through OLE Automation. The System object is at the highest level. The objects central to your client/server application are the Session object and the Screen object. A Session is the individual running instance of KEA!. One Session might be configured to use telnet to a Unix host, another configured to use LAT to a VAX host.

If you have used KEA! as a VT emulator you may have difficulty separating the ideas of Session and Screen. It would seem there is exactly one screen for the session--they appear to be one and the same thing. However, in client/server mode you may not want the screen to be visible. The session controls the connectivity and the framework in which the screen sits. The session may be used to perform file transfers. The screen is the place where the terminal emulation is painted; it has the characters received from the host.

These objects give your program access to other objects as shown in the hierarchy diagram . You can work with areas of the screen or the cursor for the session.

A System object or the Session object may be created by Visual Basic commands as shown in the examples below.

You can start the System object with the Visual Basic CreateObject function. The following lines of code create a new System object or get an already running System object:

Dim Sys As System
Set Sys = CreateObject("KEA.System")

The following lines create a new Session object:

Dim Sess As Session
Set Sess = CreateObject("KEA!.Session")

Creating a KEA! session using Visual Basic's GetObject function.

The GetObject function offers a more direct way to start a new Session object, or retrieve an existing Session object. In the following GetObject syntax, PathToMyKtcFile represents a string which is the path to the particular session configuration file describing the session you want to create. Such files have a KTC extension.

GetObject([PathToMyKtcFile][, "KEA!.Session"])

Both parameters are optional. The various combinations produce the following effects.

Set Sess = GetObject("FileA")

Opens a session using the configuration file FILEA.KTC. If a session using this file is already open, the existing session is retrieved.

 Example

Set Sess = GetObject("FileA", "KEA!.Session")

Opens a session using the configuration file FILEA.KTC. If a session using this file is already open, a second session of this type is started.

Set Sess = GetObject( , "KEA!.Session")

If any KEA sessions are open, one of them is used. If no session exists, an error results.

 Example

Set Sess = GetObject("" , "KEA!.Session")

A new session is started, showing the name "None" in its title bar. Any existing sessions are unchanged.

Retrieving Objects

You can retrieve objects with functions, properties, and methods. When you have a System or Session object you can use it to obtain other object types. For example, you can get a Screen object from a Session object by using the Session object's Screen property. Objects returned in this way are referred to as sub-objects.

Each KEA! object has properties that return references to other objects. For example, the expression System.Sessions returns a reference to a Sessions collection object. The expression Session.Screen returns a reference to a Screen object.

Some objects also include methods that return references to objects. For example, the expression Screen.Area(1,1,10,80) returns an Area object corresponding with an area of the screen.

See Also

The Hierarchy Diagram

Referencing Objects

Collections

Wait-type Objects

Waiting For Several Events

Controlling Changes While Monitoring Events

Removing Objects


Referencing Objects

You can retrieve objects with functions, properties, and methods. To reference or control a retrieved object, you must assign an object reference to an object variable. First, declare an object variable with a Dim, Static, or Global statement. Next, use the Set statement to assign to the object variable a reference to the object.

Note: The Set statement assigns an object reference to a variable, not a copy of the object. Therefore, more than one object variable can refer to the same object. Any change to an object affects all variables that reference that object.

In the following lines, two object variables are declared. In the first Set statement, the GetObject function returns a reference to a Session object, assigned to the object variables Sess. In the second Set statement, the Screen property of Sess is used. A reference to a Screen object is returned and assigned to the object variable Scrn.

Dim Sess As Session

Dim Scrn As Screen
Set Sess = GetObject("Session1.ktc")
Set Scrn = Sess.Screen

Object variables are necessary for referencing objects. However, for objects that must be retrieved but not referenced, it is more efficient to use a compound statement rather than assigning an object to a variable.

Compound Statements

A compound statement includes two or more expressions, each of which returns an object. Compound statements are useful when you have to traverse the object hierarchy to reference an object. For example, the following compound statement returns a reference to an Area object.

Set Ar = Sys.Sessions.Item(1).Screen.Area(1,1,10,80)

This statement is evaluated as follows:

Expression	Object Returned
Sys.Sessions	Sessions collection object.
Sessions.Item(1)	The first session in the collection.
Screen property	Screen object of the first session.
The Area method of the returned Screen object	An Area object that defines a screen segment from row 1, column 1 to row 10, column 80.
Because only the final Area object has to be referenced, the use of the compound statement is far more efficient than assigning multiple object references to multiple object variables. Compare the compound statement to the equivalent set of statements below.

    Dim SessionsObj As Sessions
    Dim SessionObj As Session
    Dim ScreenObj As KEA.Screen
    Dim AreaObj As Area
    Set SessionsObj = Sys.Sessions
    Set SessionObj = SessionsObj.Item(1)
    Set ScreenObj = SessionObj.Screen
    Set AreaObj = ScreenObj.Area(1, 1, 10, 80)

See Also

The Hierarchy Diagram

Creating Objects

Collections

Wait-type Objects

Waiting For Several Events

Controlling Changes While Monitoring Events

Removing Objects


Collections

The object model also shows collection objects -- Sessions, Buttons, and Waits. A collection object is referred to in the plural because it represents a set of like objects. For example, the Sessions object manages individual Session objects. When you have obtained a collection object you may access each individual object in it. Objects within a collection are sometimes referred to as elements.

A collection, which may comprise zero or more elements, includes a Count property that returns the current number of elements. For example, the expression Sys.Sessions.Count returns the number of Session objects that are currently open.

To retrieve an individual element within a collection, you must identify the element with the collection's Item method. Used with a Sessions or Buttons collection, the Item method takes a numeric argument that represents the element's ordinal position within the collection. The following expression returns Session 3, the third element in the Sessions collection object.

Sys.Sessions.Item(3)

Note: Because Item is the default method of the Sessions collection, you do not have to explicitly specify the method. Session 3 in the collection can also be referenced with Sys.Sessions(3)

Because of the way some languages work this feature may result in an error. In these implementations you will need to create an intermediate variable to hold the Sessions collection or you may use the explicit Item method.

 Example

Used with a Waits collection, the Item method takes an identifier argument that was previously returned by the Waits.Add or Waits.Wait methods.

 Example

Like any returned objects, objects returned by properties and methods of collections can be assigned to object variables. For example:

Set Sess = Sys.Sessions.Item(3)

A collection object makes it easy to perform repetitive actions on all of the objects within the collection. Using the For...Next statement is one way to step through the elements of a collection. For example, the following For...Next statement steps through all open sessions and minimizes them.

Dim Sys As System
    Dim Sess As Session

    ' Get or create a System Object
    Set Sys = CreateObject("KEA.System")

    ' Loop through all sessions and minimize each one
    For Each Sess In Sys.Sessions
        Sess.WindowState = xMINIMIZED
    Next

See Also

The Hierarchy Diagram

Creating Objects

Referencing Objects

Wait-type Objects

Waiting For Several Events

Controlling Changes While Monitoring Events

Removing Objects


Wait-type Objects

It is possible to monitor what is happening in a KEA! session. Your Visual Basic client program can specify the conditions to watch for. For example, the cursor might arrive at row 24 and column 3, or a string might appear at a particular screen location, or a series of characters might arrive in the input stream from the host. This is done by creating various wait-type objects which perform monitoring for the client program.

Some wait-type objects monitor a state:
CursorWait created by the WaitForCursor method,
DisconnectWait,
FileTransferWait,
MacroWait,
MatchWait created by the WaitForString method.

The remaining ones monitor events:
AreaWait
CursorWait created by the WaitForCursorMove method
KeyWait
MatchWait created by the WaitForStream or WaitHostQuiet methods

Creating a Wait-type Object

You create each wait-type object by calling the method that returns that particular type of object.

 Example

 Example

 Example

Monitoring with the Wait method

There are two ways to monitor the session. In the first and simplest method, the client program uses the Wait method of a wait-type object. A call to the Wait method stops further processing in the client program and only returns when the condition being monitored becomes true or a time-out period expires.

 Example

Monitoring with the Changed property

In the second method, the client program checks the Changed property of a wait-type object. A call to read the Changed property returns almost immediately. The returned value reflects the monitored condition: True or False. This way lets the program poll (periodically check the state of) the emulator. Between polls the client program can do other work.

 Example

A wait-type object is said to be changed when its Changed property is true. When a wait-type object is changed there may be a number of properties which then have valid values. For example, the Row, Col and Page properties of a CursorMove object. Before the cursor has moved, Changed will be false and Row, Col and Page will all be zero.

The action on reading the Changed property varies with each wait-type object. In general, it checks to see if the event has happened and if so makes that event current by updating the state of the wait-type object so its methods and properties reflect the new event.

The action on calling the Reset method varies with each wait-type object. In general, it restarts the waiting for events.

Implicit Wait

In some cases, a wait call is hidden. This occurs when an attempt is made to read a property whose event has not yet occurred. In the following example, an implicit Wait call is made which will return only after the cursor has moved. The variable "R" will be set to the new cursor row.

    Dim Sess As Session
    Dim W As CursorWait
    Dim R As Integer

    ' Get or start a specific session
    Set Sess = GetObject("c:\keaterm\win\user\test.ktc")

    ' Create an object to wait for the cursor to move
    Set W = Sess.Screen.WaitForCursorMove

    ' The following line performs an implicit wait if the
    ' cursor has not moved since we created the object above
    R = W.Row

See Also

The Hierarchy Diagram

Creating Objects

Referencing Objects

Collections

Waiting For Several Events

Controlling Changes While Monitoring Events

Removing Objects


Waiting For Several Events

Each of the wait-type objects allow a client program to wait for one event. However, it is possible for a host to respond to a user in a number of ways. There may be a variety of error conditions, there may be network broadcast messages or, in the case of asynchronous scrolling applications, the events don't arise in exactly the same way each time.

If you create a Waits collection, and add to it several wait-type objects, it is possible to wait for more than one event at a time.

For example, if you call the Wait method of a Waits collection, you can monitor for any of a number of events at once. The Wait method will return when the first event occurs. A waits object would be created and each wait is added while saving the identifier returned.  Then at an appropriate time a Wait method call is issued. If the  return value is non-zero then it will be one of the values returned by the Add method to tell the client program which wait was satisfied.

 Example

 Example

See Also

The Hierarchy Diagram

Creating Objects

Referencing Objects

Collections

Wait-type Objects

Controlling Changes While Monitoring Events

Removing Objects


Controlling Changes While Monitoring Events

Generally, a client program will want the state of the emulation to remain unchanged after one of the wait-type objects has become true. This allows it to process that occurrence and decide what to do next. By using the Synchronous property of the Screen object this can be controlled.

Processing in the emulator will resume when the wait-type object is polled again.

 Example

 Example

Establishing a wait-type object causes KEA! to begin monitoring for that event. When the client checks the Changed property or issues the Wait method, the client will be notified when the event has occurred (or times-out). However, if KEA! continues to accept host data, the emulation screen may change before the client can respond. That is, the cursor may have moved elsewhere, or the screen may have been repainted, etc.

If the client wishes to stop any further process when a wait object has been triggered, a Screen object's Synchronous property must be set to True. Once this has been set emulation processing is frozen unless certain conditions have been met.

In general, setting the Synchronous property to True stops host data on the input stream and the KEA! session screen remains unchanged.

(Specific) If Synchronous is true, the emulator accepts and processes host data only during an explicit or implicit wait call or while checking the Changed property. (An implicit wait occurs when a wait-type object's property is read before the event has occurred.)

 Example

See Also

The Hierarchy Diagram

Creating Objects

Referencing Objects

Collections

Wait-type Objects

Waiting For Several Events

Removing Objects


Removing Objects

When an object reference is set to Nothing or when it goes out of scope, the referenced object will go away if no other references to it exist.

The adding of an object to a collection is considered a reference and will keep the object in existence.

The Session object is treated as a special case. It may remain even if references are all removed. The Session object will remain if it is visible (see Visible property) or sub-objects exist. For example, if a Cursor object (a sub-object of Session) exists, the Session stays even though you delete the Session, until you delete the Cursor object. Although you can force a Session to go away by using the Session.Close(), Sessions.CloseAll() or System.Quit() methods even if object references exist, this is not recommended because it leaves dangling references--it is not a clean way to shut down.

You should realize that all references may not be obvious. Other references could exist in a different program.

See Also

The Hierarchy Diagram

Creating Objects

Referencing Objects

Collections

Wait-type Objects

Waiting For Several Events

Controlling Changes While Monitoring Events


Overview of Properties

An object's property is a setting or attribute that you can get (read). You can also set some properties (read-write). To refer to a property, use the following dot syntax:

object.property

By setting the values of an object's properties, you change the object's characteristics. For example, you can use the Visible property of the Session object to display or hide it. The following statement sets the Visible property to True, telling the Session object to display itself. To hide the session, you would set the property to False.

Sess.Visible = True

You can determine the visibility of the Session object as well as setting it. The following statement would return the current value of the Visible property and store it in the rc variable, which you could then display.

rc = Sess.Visible

Properties that you can both set and return, like Visible, are read-write properties. Properties whose values can only be returned are read-only properties. Most of the System object's properties are read-only. For example, you can return the values of the ActiveSession, Version, and Application properties, but you cannot change their values.

Properties that Return Objects

The value of most properties is either an integer, a character string, or a Boolean value. However, some properties return an object. In the statement below, Sess.Screen returns a reference to a Screen object. Sess is an object variable that references a Session object; Screen is a Session object property. The Set statement assigns the returned Screen object reference to the object variable Scrn.

Dim Sess As Session

Dim Scrn As Screen
Set Sess = GetObject("KEA!.Session")
Set Scrn = Sess.Screen

In the next statement, Sys.ActiveSession.Close the Session object that currently has the focus, is closed. Sys is an object variable that references the System object; ActiveSession is a property of the System object that returns the Session object that currently has or most recently had the focus. The Close part of the expression is a method of the Session object.

Dim Sys As System
Set Sys = CreateObject("KEA.System")
Sys.ActiveSession.Close

Default Properties

Most objects have a default property, that is, a property that does not have to be explicitly stated in an expression. For example, the Name property is the default for the Session object. The following two statements both return the Name value for a Session object referred to as Sess.

SessName = Sess.Name
SessName = Sess

Using defaults reduces the amount of code but may be confusing. For example, although the WaitForKeys method is documented as returning a KeyWait object, the following two lines return a string:

Dim Str As string
Str = Sess.Screen.WaitForKeys

The default property of a KeyWait object is Name. The compound statement creates the KeyWait object, waits for a keystroke (which sets the Name property to that keystroke), returns the default property (Name) and destroys the KeyWait object. A string is returned. The same result is shown in the following lines of equivalent code.

    Dim Str As String
    Dim KW As KeyWait
    Set KW = Sess.Screen.WaitForKeys
    KW.Wait
    Str = KW.Name
    Set KW = Nothing

See Also

Overview of Objects

Overview of Methods

Overview of Enumerations

Setting Up Visual Basic


Overview of Methods

Some methods are commands that direct an object to perform an action. For example, the Copy method of the Screen object copies the selected screen area to the Clipboard.

Other methods merely return an object, such as the Item method of the Sessions object which returns a Session object.

Method Syntax

To refer to a method, use the following dot syntax:

object.method

Some methods take arguments:

object.method arg1,arg2,...

Some methods return values as well:

rc = object.method (arg1,arg2,...)

Note the syntax difference in the last two statements: when the return value is saved to a variable, the arguments are enclosed in parentheses. Even if there is no argument list, include parentheses:

rc = object.method ( )

Default Methods

For most collections, Item is the default method. That is, Item does not have to be explicitly stated in an expression. For example, each of the following two statements closes the third session in the Sessions collection:

Sys.Sessions.Item(3).Close
-or-
Sys.Sessions(3).Close

Note: Because of the way some languages work this feature may result in an error. In these implementations you will need to create an intermediate variable to hold the Sessions collection or you may use the explicit Item method.

 Example

See Also

Overview of Objects

Overview of Properties

Overview of Enumerations

Setting Up Visual Basic


Overview of Enumerations

Enumerations are lists of specific integer values which could be used in the code. Using such a value yields more readable code and allows compile time checking for valid property values. Of course, you can also use the integer values directly. Unless otherwise mentioned, the values of an enumeration are assigned starting at zero and increasing by one.

For example, the three possible values for the Session object's WindowState property are given by the enumeration WINDOW_STATE, which contains xMINIMIZED, xNORMAL, and xMAXIMIZED. The following equivalent statements each cause the KEA! Session object referenced by Sess to be maximized.

Sess.WindowState = xMAXIMIZED

Sess.WindowState = 3

You may use KEA! supplied enumerations in your code if you first set up your development environment to make direct reference to the KEA! Type Library.

See Also

Overview of Objects

Overview of Properties

Overview of Methods

Setting Up Visual Basic


Setting Up Visual Basic

Setting up Visual Basic (or other development environment) to make use of KEA! OLE Automation.

It is not absolutely necessary to set up your development environment but you can create a more productive environment by allowing Visual Basic (for example) to have direct access to the descriptions of the KEA! objects and help.

The following procedure allows you to code statements such as:

Dim KW As KeyWait

instead of

Dim KW As Object

This allows Visual Basic to check that only KeyWait objects are assigned to this object.

In addition, the VB object browser will be able to access KEA! objects and you can access help for KEA! objects directly from VB without having to run KEA!.

To set up Visual Basic so it can access KEA! objects

1	In Visual Basic, on the Tools menu, select References.

2	On the list of available OLE resources, check the KEA! Type Library. Your Visual Basic code will now have access to the KEA! objects, properties, methods, and enumerations.

Note: If the KEA! Type Library does not appear on this list, KEA! is not yet registered. Run KEA! once to allow it to register itself. Then re-try this procedure.

To browse KEA! objects from within Visual Basic

1	In Visual Basic, on the View menu, select Object Browser.

2	Find KEA! in the pull-down list and select objects listed. Click the ? button to display the KEA! OLE Automation help topic for the selected element.