my objective is to check if the switch prompt either ">" or "#" if prompt to ">" to send enable password then the command. if the switch prompt to "#" send just the command. but some reason go to directly to the command with out checking the condition.
` result = crt.Screen.WaitForString ([">","#"])
If (result=1) Then
crt.Screen.Send chr(13)
crt.Screen.Send "XXXXX" & chr(13)
crt.Screen.WaitForString "Password: "
crt.Screen.Send "a" & chr(13)
crt.Screen.WaitForString "#"
End If
'++++++++++Now Send the command ++++++++++
crt.Screen.Send "sh ver" & chr(13)
crt.Screen.WaitForString vbcr
strReadScreen = crt.Screen.ReadString("#")`