Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-10-2019, 05:19 AM
rader107 rader107 is offline
Registered User
 
Join Date: Jul 2019
Posts: 2
add delay in script.but it don't work

Code:
#$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
	Dim item
	For item = 0 To 20
		crt.Screen.Send chr(13)
		crt.Screen.Send "date" & chr(13)
		crt.Screen.Send chr(13)
		crt.Sleep 10000
	Next
End Sub

I add "crt.Sleep 10000",but SecyreCRT no response, my version is 6.7.2
Reply With Quote
  #2  
Old 07-10-2019, 08:01 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,894
Hi rader107,
Quote:
I add "crt.Sleep 10000",but SecyreCRT no response, my version is 6.7.2
You put in a sleep(), so no response (at least for 10 seconds) would be exactly what I expect to happen.

Version 6.7.2 is quite old. Please elaborate on what's going on. Are you getting the expected output? Does it appear the script is hanging (and not continuing through the iterations)? Is Cancel available from the Script menu?

In your code, you are overlooking an important rule of scripting which is to have a WaitForString() for every Send().

That info is covered in section 4.2 of the Scripting Essentials guide on our website here.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730

Last edited by bgagnon; 07-11-2019 at 07:27 AM. Reason: corrected one second to 10 secs
Reply With Quote
  #3  
Old 07-10-2019, 08:40 PM
rader107 rader107 is offline
Registered User
 
Join Date: Jul 2019
Posts: 2
when I add the line "crt.Sleep 10000",there is no output;
just I cancel, Script can continue
Reply With Quote
  #4  
Old 07-11-2019, 07:26 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,894
Hi rader107,

If you do not include the WaitForString() lines, then set Synchronous to False.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730

Last edited by bgagnon; 07-11-2019 at 07:44 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 11:07 AM.