View Single Post
Old 05-13-2021, 10:18 AM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,099
Reading SecureCRT's built-in help documentation, one can see that the return value from a call to the WaitForStrings() method is not a string. Instead, the return value is the *index* of the matched string provided as an parameter when you made the function call.
In other words, if your code looks like this...
result = crt.Screen.WaitForStrings("17.5","19.02", 4)
...and what appears on your screen is a "19.02", the documentation makes clear that the expected return value is exactly what you are seeing: 2

The value 2 reflects the 2nd string argument you provided to the WaitForStrings("17.5", "19.02", etc.) method is the string that was matched/found on the screen (or, if you sent an array of strings, the 2nd element of that array).

Attached Images
File Type: gif SCRT_Help_WaitForStrings_ReturnValues.gif (100.9 KB, 419 views)
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel:
Reply With Quote