Robertson1995
Board Regular
- Joined
- Apr 1, 2009
- Messages
- 123
I am using an interface program called Reflections WRQ and need help. Basically I am entering a command called RunTest which displays about 200 rows of data. The command runs fine, but I only need the first 5 rows of data. Is there a way to stop the macro after the 5th row is displayed instead of displaying all of the rows. For example, my 5th row will always be "number of users=1". Is there a way to make the macro stop when it sees this text? Thanks in advance for any help
Sub Test()
On Error GoTo ErrorHandler
Const NEVER_TIME_OUT = 0
Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M
LF = Chr(Reflection2.ControlCodes.rcLF)
CR = Chr(Reflection2.ControlCodes.rcCR)
With Session
.Transmit "RunTest" & CR
' .WaitForString LF & "/home/test> ", NEVER_TIME_OUT, rcAllowKeystrokes
End With
Exit Sub
ErrorHandler:
Session.MsgBox Err.Description, vbExclamation + vbOKOnly
End Sub
Sub Test()
On Error GoTo ErrorHandler
Const NEVER_TIME_OUT = 0
Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M
LF = Chr(Reflection2.ControlCodes.rcLF)
CR = Chr(Reflection2.ControlCodes.rcCR)
With Session
.Transmit "RunTest" & CR
' .WaitForString LF & "/home/test> ", NEVER_TIME_OUT, rcAllowKeystrokes
End With
Exit Sub
ErrorHandler:
Session.MsgBox Err.Description, vbExclamation + vbOKOnly
End Sub