WaitHostQuiet Method Example

The example uses WaitHostQuiet and SendKeys to page through host demonstration screens (using the SlideShow connection type). Note that with the exception of the first instance of SendKeys, this method is only executed if the WaitHostQuiet method returns TRUE.

Sub Main()

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

 

 Set Sys = CreateObject("EXTRA.System")

' Assumes an open session

 Set Sess = Sys.ActiveSession

 Set MyScreen = Sess.Screen

 

 Sys.TimeoutValue = 9000

 

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

 MyScreen.SendKeys ("a<Enter>")

 Wait1st = MyScreen.WaitHostQuiet(9000)

 If Wait1st Then

  MyScreen.SendKeys ("user1<Enter>")

  Wait2nd = MyScreen.WaitHostQuiet(9000)

  If Wait2nd Then

  MyScreen.SendKeys ("logoff<Enter>")

  Wait3rd = MyScreen.WaitHostQuiet(9000)

  End If

 End If

 If Not (Wait1st And Wait2nd And Wait3rd) Then MsgBox "Error navigating host screens."

End Sub