Jump to content

missing endswitch & other errors


pcjunki
 Share

Recommended Posts

I have a gui that works just find, and  I upgraded my scite from here

now running the script from scite, I see where au3check is being run and shows me errors in my script

I've attached a screenshot of the errors I'm getting.

what am I doing wrong?

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=\\server53\share7\scripts\icons\librarypublic.ico
#AutoIt3Wrapper_Res_Description=public machines
#AutoIt3Wrapper_Res_Fileversion=1.0.0.1
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=pcjunki
#AutoIt3Wrapper_Res_Language=1033
#AutoIt3Wrapper_Run_AU3Check=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>


#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Public Computers", 442, 223, 419, 378)

$Label1 = GUICtrlCreateLabel("Computer", 16, 24, 100, 25)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")



$Combo1 = GUICtrlCreateCombo("", 16, 50, 170, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "pub01|pub02|pub03|pub04|pub05|pub06|pub07|pub08|pub09|pub10|pub11|pub12|pub13|pub15|pub16|pub17|pub18|pub19|pub20|pub21|pub22|pub23|pub24|pub25")
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")


$Label2 = GUICtrlCreateLabel("Task", 224, 24, 100, 25)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")

$Combo2 = GUICtrlCreateCombo("", 224, 48, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "ScreenView|ping_host|")
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")


$Button1 = GUICtrlCreateButton("Run", 224, 104, 115, 65)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###



While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $pc = GUICtrlRead($Combo1)
            $command = GUICtrlRead($Combo2)
            Call($command, $pc)

            Func screenview($pc)
                ShellExecute("C:\Program Files\vncviewer.exe", $pc & " /password magicpwd")
            EndFunc   ;==>screenview



            Func ping_host($pc)
                Run(@ComSpec & ' /c ' & 'ping' & " " & $pc & ' -t')
            EndFunc   ;==>ping_host


    EndSwitch
WEnd

 

post-65063-0-00277600-1421183959_thumb.p

Link to comment
Share on other sites

  • Moderators

pcjunki,

Move the 2 function definitions outside the Switch structure. ;)

M23

Edited by Melba23
Fixed BB tags

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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...