Xshell Forum

WaitForStrings Return Value ERROR

Last post: Monday, April 11, 2016 7:20 PM by Support, 1 reply

 
Tuesday, April 5, 2016 10:00 AM - test

WaitForStrings Return Value ERROR

 
WaitForStrings(VARIANT FAR* strArray, long nTimeout)
strArray
Character string to be displayed on the terminal
nTimeout
Wait time millisecond value
Return Value
The number of found strings.




Return Value = ”0“,it's always return 0.


return= WaitStrings ("$,],#",2)
msgbox(return) ,retrun 0 all the time
FUNCTION WaitStrings(strArry,ntime)
strArry=split(strArry,",")
xsh.Session.sleep 50
WaitStrings = xsh.Screen.WaitForStrings(strArry,ntime*1000)
END FUNCTION

Program Ver. : Xshell 5
Monday, April 11, 2016 7:20 PM - Support

Re: WaitForStrings Return Value ERROR

 
I've checked your script and there seem to be no issues with the script itself. A return value of 0 means no string is shown during a given time. Try increasing the wait time value.

I tested with this script:

Sub Main
return= WaitStrings ("$,],#", 5)
xsh.dialog.msgbox(return)
End Sub
FUNCTION WaitStrings(strArry,ntime)
strArry=split(strArry,",")
xsh.Session.sleep 50
WaitStrings = xsh.Screen.WaitForStrings(strArry,ntime*1000)
END FUNCTION
Technical Support

Like us on Facebook
Follow us on Twitter
Visit our blog Blog