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 10-17-2018, 09:36 AM
jlev jlev is offline
Registered User
 
Join Date: Oct 2018
Posts: 1
Send and sleep - slow when running script

Any advice or further information on the Sleep() method would be greatly appreciated. I've read many other threads about WaitForString, but have not needed to utilize it in older versions of SecureCRT. The issue has only been experienced in v6.6.1 (build 289).

We use SecureCRT to display a form like UI on the screen. In most cases my script waits (Sleep) until the cursor is in a specific location for a certain amount of time (Do/Loop w/ Sleep) before it sends a string & CR and finds those specific cursor locations during initialization.

In the initialization, I use the function below quite often to get to a standard starting point, but the screen is not updating like it does with older versions. No issues with v6.5.4(build 555).

Code:
Function backToHomeMenu()
        For counter = 1 To 50
                crt.sleep 500
                menuOption = Trim(crt.screen.get(1, 53, 1, 60))
                If menuOption = "MENUTXT" Then
                        Exit Function
                ElseIf menuOption = "MENU2TXT" Then
                        crt.Screen.Send "1" & vbCr
                        crt.sleep 500
                Else
                        crt.Screen.Send vbCr
                        crt.sleep 500
                End If
        Next
End Function
Function aCursorSend(r, c, wordsToSend)
        Dim rRow, cCol, curRow, curCol
        For counter = 1 To 800
                crt.sleep 20
                rRow = r
                cCol = c
                curRow = crt.screen.CurrentRow
                curCol= crt.screen.CurrentColumn
                If curRow = rRow Then
                        If curCol = cCol Then
                                crt.screen.send wordsToSend & vbcr
                                crt.sleep 40
                                Exit Function
                        End If
                End If
        Next
End Function
Thank you in advance for any help you can give!
Reply With Quote
  #2  
Old 10-17-2018, 09:59 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,570
Hi jlev,

I can find nothing that would point to a change in behavior of the Sleep() function between the versions you have listed.

So I would say if v6.5.4 works as desired, then maybe just continue using the older version.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
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 09:23 AM.