Xshell Forum

WaitForStrings cannot timeout

Last post: Wednesday, August 19, 2015 9:24 AM by test, 2 reply

 
Sunday, June 12, 2011 10:42 PM - dugu

WaitForStrings cannot timeout

 
Version: Xshell4 Build 0091
Xshell.exe: 4.0.0091, nssock2.dll: 4.0.0009, nsssh3.dll: 4.0.0020, nsprofile2.dll: 4.0.0014, nslicense.dll: 4.0.0008, nsutil2.dll: 4.0.0027, nsverchk.exe: 4.0.0001, Xagent.exe: 4.0.0008, Xactivator.exe: 4.0.0009

Take an example, I hope wait for some string after ESC, but it should timeout in 5 secs, however, timeout never take effect.

Sub Main
xsh.Screen.Send chr(&H1b)
file.Write "Send ESC at " & Now & vbCrLf
result = xsh.Screen.WaitForStrings(prompt, 5000)
file.Write "Stop wait at" & Now & vbCrLf
xsh.Screen.Send chr(&H1b)
End Sub


I wait for a long time, and the file only write:
Send ESC at 6/13/2011 1:36:50 PM


Thus, I think it might be an issue of 'WaitForStrings' ?

Program Ver. : Xshell 4
Monday, June 13, 2011 2:28 AM - Support

Re: WaitForStrings cannot timeout

 
I think there is a problem with the WaitForStrings function. We will fix the problem shortly.

---
Technical Support
Wednesday, August 19, 2015 9:24 AM - test

Re: WaitForStrings cannot timeout

 
help!
Sub main
xsh.Screen.Send vbcrlf
xsh.Screen.WaitForString "]"
Crow=xsh.screen.CurrentRow
logfile = xsh.Screen.Get(Crow,1,Crow,40)
logfile = rtrim(logfile)
Set WshShell = CreateObject("Wscript.Shell")
DESK = WshShell.SpecialFolders("Desktop")
xsh.Session.LogFilePath = DESK&"\backup\"&logfile&".txt"
xsh.Screen.Synchronous = false
'xsh.Session.Logging = true
xsh.Session.StartLog
xsh.Session.sleep 100
xsh.Screen.Send "show running" & vbcr
REM if xsh.Screen.waitForString ("More" ) = false then
'xsh.dialog.msgbox "nothing"
REM end if
xsh.dialog.msgbox xsh.Screen.waitForStrings ("this didn't work !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",1000 )
'showall

xsh.screen.clear
xsh.Session.StopLog
xsh.Session.Close
end sub