Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-18-2012, 10:13 AM
varondan varondan is offline
Registered User
 
Join Date: Dec 2012
Posts: 3
crt.Sleep not work

Hi,

I need use a script with a delay in the commands.

I find the command crt.Sleep but I use it but no do a delay in the commands.
I canīt ude crt.Screen.WaitForString in my case.
Tested in version 6.6 and 7.2 SecureCRT.

example:
.......................................................
#$language = "VBScript"
#$interface = "1.0"

crt.Screen.Synchronous = True

' This automatically generated script may need to be
' edited in order to work correctly.

Sub Main
crt.screen.send chr(13)
crt.screen.send "show system info" & chr(13)
crt.Screen.Send vbCr
crt.Sleep 10000
crt.screen.send "show jobs all" & chr(13)
crt.Screen.Send vbCr
crt.Sleep 10000
crt.screen.send "request system software info " & chr(13)
crt.Screen.Send vbCr
crt.Sleep 10000
crt.screen.send "end" & chr(13)
End Sub
.......................................................

If I run this script, I see no do anything in 20 segs aprox, and do all.
No execute the crt.Sleep

Anything can help me?

Regards
varondan
Reply With Quote
  #2  
Old 12-18-2012, 10:52 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi varondan,

Thanks for the question. When setting the Screen object's Synchronous property to True, you will not see anything in the SecureCRT terminal window until you issue a WaitForString(), WaitForStrings() or ReadString() call. You will also see the data appear after the script completes which appears to be what is happening in your case.

Does this help to explain the behavior you are seeing?

If you comment out the line setting the Synchronous property to True (not recommended, but neither is not using a WaitForString(), etc. call in general) do you see the behavior you want?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 12-19-2012, 09:23 AM
varondan varondan is offline
Registered User
 
Join Date: Dec 2012
Posts: 3
Hi rtb

Now work!!!
If I use crt.Screen.Synchronous = False, I test and work correctly.

I have any crt.Screen.WaitForString and all work correctly.

Thanks for all!!!

Regards
Varondan
Reply With Quote
Reply

Tags
crt.sleep , sleep

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:13 AM.