View Single Post
  #2  
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,098
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...
Code:
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).

--Jake
Attached Images
File Type: gif SCRT_Help_WaitForStrings_ReturnValues.gif (100.9 KB, 161 views)
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote