Quote Originally Posted by mitch27 View Post
If I removed them, what would I use to indicate the stopping point for the loop?
My suggestion was something like this
Code:
Sub TestGoTo()

    On Error GoTo ErrorHandler

    Const NEVER_TIME_OUT = 0

    Dim ESC As String   ' Chr(rcESC) = Chr(27) = Control-[

    ESC = Chr(Reflection2.ControlCodes.rcESC)

    With Session

StartLoop:
    .TransmitTerminalKey rcVtUpKey
    If .StatusBar <> "" Then
        GoTo ExitLoop
    Else
        .TransmitTerminalKey rcVtSelectKey
        .TransmitTerminalKey rcVtRemoveKey
        .Transmit CR
        '.StatusBar = ""
        .Transmit "Y"
        '.StatusBar = ""
        .Transmit CR
    End If
    GoTo StartLoop

ExitLoop:
    Debug.Print .StatusBar    ' display the contents of StatusBar in the Immediate Window
    .Transmit CR
    .Transmit CR
    Exit Sub
ErrorHandler:
    Session.MsgBox Err.Description, vbExclamation + vbOKOnly
    
    End With
    
End Sub