junoflydog
Technical User
How can I use "WaitForString" with multiple responses?
This might not even be the correct command to use.
I want to send a command then wait for a response before I proceed. I have no problem writing this code waiting for a single known response, but I may need to wait or have a conditional branch depending on multiple responses. I will have a set of known responses I can test against, but only one response will occur.
For example the response may be "completed" or "not found". One response I would want to continue the macro, the other end or branch to a new macro.
.Transmit my_Command
.WaitForString "completed" ' continue with macro_1
or
.WaitForString "not found" ' end macro or go to macro_2
*************
almost something like ->
.WaitForString {
"completed" then continue
"not found" then macro_2
"error" then End Sub
}
**************
If there is a better command, I am open for suggestions.
Thanks,
JunoFlyDog