Jump to content

Dumbfounded with an SciTE Compile Error


Recommended Posts

I am stuck on a piece of code. It has nested case statements and the error SciTE is giving me is

(154) : ==> "EndSelect" statement with no matching "Select" statement.: EndSelect

Line 154 is the first EndSelect Statement in the code snippet below.

Any help is greatly appreciated.

Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
        
    Case $msg = $Button_B
        GUICtrlRead ( $Input2 )
        Select 
            Case $Input2 = ""
            GuiSetState(@SW_MINIMIZE, $gui_Main)
                ProgressOn("Progress Meter", "Scanner is Processing Scan...", "0 % Complete",-1,-1,1)
                    For $i = 0 to 100 step 0.78
                sleep(1000)
                ProgressSet( $i, $i & " % Complete")
                    Next
                ProgressSet(100 , "Done", "Complete")
                sleep(500)
                ProgressOff()
            $FileID = GuiCtrlRead($Input1)
            $sURL4 = "http://www.adomain.com/upload/" & $FileID & ".pdf"
            $sGF = @scriptdir & "\" & $FileID & ".pdf"
                ProgressOn("Aquiring Closing Packet From Scanner", "Aquiring Closing Packet From Scanner", "0%", -1, -1, 1 )
            $fSize = InetGetSize( $sURL4 ); checking the size before to start
                ProgressSet( 0, '0%', "Initializing Download")
                InetGet( $sURL4, $sGF, 1, 1); request the file
        ; Downloading process
            While @InetGetActive
            $bytesR = @InetGetBytesRead;macro reading the progress
            $bPercent = Round(($bytesR / $fSize) * 100)
                ProgressSet( $bPercent, $bPercent  & "% ( " & Round($bytesR/1024) & 'kb / '  & Round($fSize/1024) & 'kb )', 'Aquiring Closing Packet From Scanner')
                Sleep(100); to reduce the flickering
            WEnd
                ProgressOff()
                sleep(5000)
                runWait(@COMSPEC & " /c CreateCD -r:e -nologo -eject " & $FileID & ".pdf", "", @SW_show)
                Sleep(5000)
                FileDelete($sGF)
                GuiSetState(@SW_RESTORE, $gui_Main)
            Case
            GuiSetState(@SW_MINIMIZE, $gui_Main)
                ProgressOn("Progress Meter", "Scanner is Processing Scan...", "0 % Complete",-1,-1,1)
                    For $i = 0 to 100 step 0.47
                sleep(1000)
                ProgressSet( $i, $i & " % Complete")
                    Next
                ProgressSet(100 , "Done", "Complete")
                sleep(500)
                ProgressOff()
            $FileIDr2a = GuiCtrlRead($Input1)
            $FileIDr2b = GuiCtrlRead($Input2)
            $sURLr2a = "http://www.adomain.com/upload/" & $FileIDr2a & ".pdf"
            $sURLr2b = "http://www.adomain.com/upload/" & $FileIDr2b & ".pdf"
            $sGFr2a = @scriptdir & "\" & $FileID & ".pdf"
            $sGF2rb = @scriptdir & "\" & $FileID & ".pdf"
                ProgressOn("Aquiring 1st Closing Packet From Scanner", "Aquiring 1st Closing Packet From Scanner", "0%", -1, -1, 1 )
            $fSize = InetGetSize( $sURLr2a ); checking the size before to start
                ProgressSet( 0, '0%', "Initializing Download")
                InetGet( $sURLr2a, $sGFr2a, 1, 1); request the file
        ; Downloading process
            While @InetGetActive
            $bytesR = @InetGetBytesRead;macro reading the progress
            $bPercent = Round(($bytesR / $fSize) * 100)
                ProgressSet( $bPercent, $bPercent  & "% ( " & Round($bytesR/1024) & 'kb / '  & Round($fSize/1024) & 'kb )', 'Aquiring Closing Packet From Scanner')
                Sleep(100); to reduce the flickering
                ProgressOn("Aquiring 2nd Closing Packet From Scanner", "Aquiring 2nd Closing Packet From Scanner", "0%", -1, -1, 1 )
            $fSize = InetGetSize( $sURLr2b ); checking the size before to start
                ProgressSet( 0, '0%', "Initializing Download")
                InetGet( $sURLr2b, $sGFr2b, 1, 1); request the file
        ; Downloading process
            While @InetGetActive
            $bytesR = @InetGetBytesRead;macro reading the progress
            $bPercent = Round(($bytesR / $fSize) * 100)
                ProgressSet( $bPercent, $bPercent  & "% ( " & Round($bytesR/1024) & 'kb / '  & Round($fSize/1024) & 'kb )', 'Aquiring Closing Packet From Scanner')
                Sleep(100); to reduce the flickering
            WEnd
                ProgressOff()
                sleep(5000)
                runWait(@COMSPEC & " /c CreateCD -r:e -nologo -eject " & $FileIDr2a & ".pdf " & $FileIDr2b & ".pdf", "", @SW_show)
                Sleep(5000)
                FileDelete($sGF)
                GuiSetState(@SW_RESTORE, $gui_Main)
        EndSelect
    Case $msg = $Button_RP
    GuiSetState(@SW_Hide, $gui_Main)
        SplashOff()
        ProgressOn("Downloading CD Burning Subsystem", "Searching For CD Burning Subsystem...", "0%", -1, -1, 16 )
        $fSize = InetGetSize( $sURL ); checking the size before to start
        ProgressSet( 0, '0%', "Initializing Download")
        InetGet( $sURL, $sLocalFile, 1, 1); request the file
; Downloading process
        While @InetGetActive
            $bytesR = @InetGetBytesRead;macro reading the progress
            $bPercent = Round(($bytesR / $fSize) * 100)
            ProgressSet( $bPercent, $bPercent  & "% ( " & Round($bytesR/1024) & 'kb / '  & Round($fSize/1024) & 'kb )', 'Downloading CD Burning Subsystem...')
            Sleep(100); to reduce the flickering
        WEnd
        ProgressOn("Downloading IE Registry Fix", "Searching For IE Registry Fix...", "0%", -1, -1, 16 )
        $fSize = InetGetSize( $sURL2 ); checking the size before to start
        ProgressSet( 0, '0%', "Initializing Download")
        InetGet( $sURL2, $sLocalFile2, 1, 1); request the file
; Downloading process
        While @InetGetActive
            $bytesR = @InetGetBytesRead;macro reading the progress
            $bPercent = Round(($bytesR / $fSize) * 100)
            ProgressSet( $bPercent, $bPercent  & "% ( " & Round($bytesR/1024) & 'kb / '  & Round($fSize/1024) & 'kb )', 'Downloading IE Registry Fix...')
            Sleep(100); to reduce the flickering
        WEnd
        ProgressOff()
        run(@COMSPEC & " /c " & $sLocalFile2, "", @SW_show)
    GuiSetState(@SW_SHOW, $gui_Main)
    Case $msg = $Button_UD
    GuiSetState(@SW_Hide, $gui_Main)
        $sURL3 = $UpdaterDLAddress
        SplashOff()
        ProgressOn("Aquiring Updater", "Aquiring Updater...", "0%", -1, -1, 16 )
        $fSize = InetGetSize( $sURL3 ); checking the size before to start
        ProgressSet( 0, '0%', "Initializing Download")
        InetGet( $sURL3, $sUpdateFile, 1, 1); request the file
; Downloading process
        While @InetGetActive
            $bytesR = @InetGetBytesRead;macro reading the progress
            $bPercent = Round(($bytesR / $fSize) * 100)
            ProgressSet( $bPercent, $bPercent  & "% ( " & Round($bytesR/1024) & 'kb / '  & Round($fSize/1024) & 'kb )', 'Aquiring Updater...')
            Sleep(100); to reduce the flickering
        WEnd
        ProgressOff()
        Run($sUpdateFile)
        ExitLoop
    EndSelect
Link to comment
Share on other sites

At a quick glance, your case statement on line 32 has no expression...

also, line 75 has an Endselect, but is followed by a case statement

Errors are easier to see when its correctly indented

Select
    Case $Input2 = ""
        GuiSetState(@SW_MINIMIZE, $gui_Main)
        ProgressOn("Progress Meter", "Scanner is Processing Scan...", "0 % Complete",-1,-1,1)
        For $i = 0 to 100 step 0.78
            sleep(1000)
            ProgressSet( $i, $i & " % Complete")
        Next
            ProgressSet(100 , "Done", "Complete")
            sleep(500)
            ProgressOff()
            $FileID = GuiCtrlRead($Input1)
            $sURL4 = "http://www.adomain.com/upload/" & $FileID & ".pdf"
            $sGF = @scriptdir & "\" & $FileID & ".pdf"
            ProgressOn("Aquiring Closing Packet From Scanner", "Aquiring Closing Packet From Scanner", "0%", -1, -1, 1 )
            $fSize = InetGetSize( $sURL4 ); checking the size before to start
            ProgressSet( 0, '0%', "Initializing Download")
            InetGet( $sURL4, $sGF, 1, 1); request the file
            ; Downloading process
        While @InetGetActive
            $bytesR = @InetGetBytesRead;macro reading the progress
            $bPercent = Round(($bytesR / $fSize) * 100)
            ProgressSet( $bPercent, $bPercent  & "% ( " & Round($bytesR/1024) & 'kb / '  & Round($fSize/1024) & 'kb )', 'Aquiring Closing Packet From Scanner')
            Sleep(100); to reduce the flickering
        WEnd
            ProgressOff()
            sleep(5000)
            runWait(@COMSPEC & " /c CreateCD -r:e -nologo -eject " & $FileID & ".pdf", "", @SW_show)
            Sleep(5000)
            FileDelete($sGF)
            GuiSetState(@SW_RESTORE, $gui_Main)
    Case
        GuiSetState(@SW_MINIMIZE, $gui_Main)
        ProgressOn("Progress Meter", "Scanner is Processing Scan...", "0 % Complete",-1,-1,1)
        For $i = 0 to 100 step 0.47
            sleep(1000)
            ProgressSet( $i, $i & " % Complete")
        Next
        ProgressSet(100 , "Done", "Complete")
        sleep(500)
        ProgressOff()
        $FileIDr2a = GuiCtrlRead($Input1)
        $FileIDr2b = GuiCtrlRead($Input2)
        $sURLr2a = "http://www.adomain.com/upload/" & $FileIDr2a & ".pdf"
        $sURLr2b = "http://www.adomain.com/upload/" & $FileIDr2b & ".pdf"
        $sGFr2a = @scriptdir & "\" & $FileID & ".pdf"
        $sGF2rb = @scriptdir & "\" & $FileID & ".pdf"
        ProgressOn("Aquiring 1st Closing Packet From Scanner", "Aquiring 1st Closing Packet From Scanner", "0%", -1, -1, 1 )
        $fSize = InetGetSize( $sURLr2a ); checking the size before to start
        ProgressSet( 0, '0%', "Initializing Download")
        InetGet( $sURLr2a, $sGFr2a, 1, 1); request the file
        ; Downloading process
        While @InetGetActive
            $bytesR = @InetGetBytesRead;macro reading the progress
            $bPercent = Round(($bytesR / $fSize) * 100)
            ProgressSet( $bPercent, $bPercent  & "% ( " & Round($bytesR/1024) & 'kb / '  & Round($fSize/1024) & 'kb )', 'Aquiring Closing Packet From Scanner')
            Sleep(100); to reduce the flickering
            ProgressOn("Aquiring 2nd Closing Packet From Scanner", "Aquiring 2nd Closing Packet From Scanner", "0%", -1, -1, 1 )
            $fSize = InetGetSize( $sURLr2b ); checking the size before to start
            ProgressSet( 0, '0%', "Initializing Download")
            InetGet( $sURLr2b, $sGFr2b, 1, 1); request the file
            ; Downloading process
            While @InetGetActive
                $bytesR = @InetGetBytesRead;macro reading the progress
                $bPercent = Round(($bytesR / $fSize) * 100)
                ProgressSet( $bPercent, $bPercent  & "% ( " & Round($bytesR/1024) & 'kb / '  & Round($fSize/1024) & 'kb )', 'Aquiring Closing Packet From Scanner')
                Sleep(100); to reduce the flickering
            WEnd
            ProgressOff()
            sleep(5000)
            runWait(@COMSPEC & " /c CreateCD -r:e -nologo -eject " & $FileIDr2a & ".pdf " & $FileIDr2b & ".pdf", "", @SW_show)
            Sleep(5000)
            FileDelete($sGF)
            GuiSetState(@SW_RESTORE, $gui_Main)
EndSelect
    Case $msg = $Button_RP
        GuiSetState(@SW_Hide, $gui_Main)
        SplashOff()
        ProgressOn("Downloading CD Burning Subsystem", "Searching For CD Burning Subsystem...", "0%", -1, -1, 16 )
        $fSize = InetGetSize( $sURL ); checking the size before to start
        ProgressSet( 0, '0%', "Initializing Download")
        InetGet( $sURL, $sLocalFile, 1, 1); request the file
        ; Downloading process
        While @InetGetActive
            $bytesR = @InetGetBytesRead;macro reading the progress
            $bPercent = Round(($bytesR / $fSize) * 100)
            ProgressSet( $bPercent, $bPercent  & "% ( " & Round($bytesR/1024) & 'kb / '  & Round($fSize/1024) & 'kb )', 'Downloading CD Burning Subsystem...')
            Sleep(100); to reduce the flickering
        WEnd
        ProgressOn("Downloading IE Registry Fix", "Searching For IE Registry Fix...", "0%", -1, -1, 16 )
        $fSize = InetGetSize( $sURL2 ); checking the size before to start
        ProgressSet( 0, '0%', "Initializing Download")
        InetGet( $sURL2, $sLocalFile2, 1, 1); request the file
        ; Downloading process
        While @InetGetActive
            $bytesR = @InetGetBytesRead;macro reading the progress
            $bPercent = Round(($bytesR / $fSize) * 100)
            ProgressSet( $bPercent, $bPercent  & "% ( " & Round($bytesR/1024) & 'kb / '  & Round($fSize/1024) & 'kb )', 'Downloading IE Registry Fix...')
            Sleep(100); to reduce the flickering
        WEnd
        ProgressOff()
        run(@COMSPEC & " /c " & $sLocalFile2, "", @SW_show)
        GuiSetState(@SW_SHOW, $gui_Main)
    Case $msg = $Button_UD
        GuiSetState(@SW_Hide, $gui_Main)
        $sURL3 = $UpdaterDLAddress
        SplashOff()
        ProgressOn("Aquiring Updater", "Aquiring Updater...", "0%", -1, -1, 16 )
        $fSize = InetGetSize( $sURL3 ); checking the size before to start
        ProgressSet( 0, '0%', "Initializing Download")
        InetGet( $sURL3, $sUpdateFile, 1, 1); request the file
        ; Downloading process
        While @InetGetActive
            $bytesR = @InetGetBytesRead;macro reading the progress
            $bPercent = Round(($bytesR / $fSize) * 100)
            ProgressSet( $bPercent, $bPercent  & "% ( " & Round($bytesR/1024) & 'kb / '  & Round($fSize/1024) & 'kb )', 'Aquiring Updater...')
            Sleep(100); to reduce the flickering
        WEnd
        ProgressOff()
        Run($sUpdateFile)
        ExitLoop
EndSelect
Edited by Paulie
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...