Jump to content

Switch Case compile error


Recommended Posts

Hey all,

I have read the docs, have tried a bunch of variations but am getting stuck with a "EndSelect with no matching Select" error at runtime.

Select 
    Case $debug = "true"
    Select 
        Case $CmdLine[1] = "/startcmp1" 
            _rotateDBG()
        
        Case $CmdLine[1] = "/startserver"
            _rotateDBG()
            
        Case Else ;$CmdLine[1] <> "/startcmp1" or $CmdLine[1] = "/startserver"
            $filehandle = FileOpen($debugFile, 1)       
                If $filehandle = -1 Then
                MsgBox(0, "Error", "Unable to open file.")
                Exit
            FileWriteLine($filehandle, @CRLF & _NowTime() & " BEGIN DEBUG LOGGING" & @CRLF)
    EndSelect
EndSelect

I tried all sorts of things, but have been staring at this snippet so long I am going blind.

Please help! :whistle:

Link to comment
Share on other sites

Thanks MHz. Like I said, blinded by looking at it too long :)

Are you using SciTE, and if not, why on Earth not?! :whistle:

SciTE presents brackets on the left side of screen for nesting fuctions, automaticaly indents, and by hitting Ctl-T you get Tidy, which finds many such mistakes before you compile. Even if you don't want to ultimately compile your script, if you compile in SciTE by F7 (Production) or Alt-F7 (Beta) you get a run through the interpreter's debugger, which catches (many, many, <sigh>, many) of my mistakes.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...