WaitForCursorMove Method Example

This example moves the screen cursor and enters input to navigate through a couple of host demonstration screens (using the SlideShow connection type).

Sub Main()

 Dim Sys As Object, Sess As Object, MyScreen As Object


 Set Sys = CreateObject("EXTRA.System")

 Set Sess = Sys.ActiveSession

' Assumes an open session

 Set MyScreen = Sess.Screen


 Sys.TimeoutValue = 9000


 ' This will page through a couple of "slide show" host screens.

 MyScreen.SendKeys ("a<Enter>")

 ' This uses row and column parameters

 Move1st = MyScreen.WaitForCursorMove(-3, 10)

 If Move1st Then

  MyScreen.SendKeys ("user1<Enter>")

  ' This uses only the row optional parameter

  Move2nd = MyScreen.WaitForCursorMove(3)

  If Move2nd Then

  MyScreen.SendKeys ("logoff<Enter>")

  ' This also uses row parameter only

  Move3rd = MyScreen.WaitForCursorMove(0, 5)

  End If

 End If

 If Not (Move1st And Move2nd And Move3rd) Then MsgBox "Error navigating host screens."

End Sub