View Single Post
Old 11-01-2013, 10:32 AM
rtb rtb is offline
VanDyke Technical Support
Join Date: Aug 2008
Posts: 4,305
Hi olivebranch2006,

I have gone through the script code, and all of the problems you are seeing and will see are VBScript syntax errors rather than problems with SecureCRT. You may consider taking a look at the scripting manual that we have published at the following location:
In the first chapter of the scripting manual, we point to the Microsoft documentation on VBScript. You may want to familiarize yourself with VBScript before diving into the scripting manual.

The error you are seeing can mean that you are missing one part of a pair of statements or keywords, but it can also point to other issues in the script code. When a syntax error is encountered by a script engine, it is not always clear what was originally intended by the script author. The information that the script engine is able to provide can sometimes be difficult to interpret.

Here is an example that illustrates proper syntax and ways to make code more readable:
crt.Screen.Synchronous = True
crt.Screen.WaitForStrings "1","2","3","4"
Select Case crt.Screen.MatchIndex
    Case 1
        nNum = 1
    Case 2
        nNum = 2
    Case 3
        nNum = 3
    Case 4
        nNum = 4
End Select

If nNum = 1 Then F1

If nNum = 2 Then 
End If

If nNum = 3 Then
End If

If nNum = 4 Then
End If

Sub F1()
    MsgBox "Entered subroutine 1."
End Sub

Sub F2()
    MsgBox "Entered subroutine 2."
End Sub

Sub F3()
    MsgBox "Entered subroutine 3."
End Sub

Sub F4()
    MsgBox "Entered subroutine 4."
End Sub

VanDyke Software
Technical Support

Last edited by rtb; 11-04-2013 at 03:34 PM.
Reply With Quote