View Single Post
  #1  
Old 10-17-2018, 08:36 AM
jlev jlev is offline
Registered User
 
Join Date: Oct 2018
Posts: 3
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