Jump to content

Syntax Errors


MrWho
 Share

Recommended Posts

Hey Guys,

Could use some help ...

C:\Documents and Settings\Administrator\Desktop\test2.au3(11,67) : ERROR: syntax error

Local $DID, $FID, $GpAID, $GpBID, $GpCID, $PCLID, $ECLID, $HOWID $msg

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Administrator\Desktop\test2.au3 - 1 error(s), 0 warning(s)

#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>

Opt('MustDeclareVars', 0)

_Main()

Func _Main()
    Local $DID, $FID, $GpAID, $GpBID, $GpCID, $PCLID, $ECLID, $HOWID $msg

    GUICreate("Swiss Knife", 400, 400)

    GUICtrlCreateLabel("....... MSG MSG .....", 10, 10)
    $DID = GUICtrlCreateButton("Msg 1", 16, 64, 153, 31)
    $FID = GUICtrlCreateButton("Msg 2", 16, 104, 155, 33)
    $GpAID = GUICtrlCreateButton("Msg 3", 14, 143, 157, 33)
    $GrpahsBID = GUICtrlCreateButton("Msg 4", 17, 186, 156, 33)
    $GrpahsCID = GUICtrlCreateButton("Msg 5", 20, 225, 156, 33)
    $PCLID = GUICtrlCreateButton("Msg 6", 18, 264, 372, 33)
    $ECLID = GUICtrlCreateButton("Msg 7", 23, 300, 372, 33)
    $HOWID = GUICtrlCreateButton("Msg 8", 27, 335, 372, 33)

    $MonthCal1 = GUICtrlCreateMonthCal("2009/11/30", 208, 56, 184, 177)

    GUISetState()  ; display the GUI

    Do
        $msg = GUIGetMsg()

        Select
            Case $msg = $DID
                ShellExecute("C:\Documents and Settings\All Users\Desktop\test1.bat", "", @ScriptDir, "")
            Case $msg = $FID
                ShellExecute("C:\Documents and Settings\All Users\Desktop\test2.bat", "", @ScriptDir, "")
            Case $msg = $GpAID
                ShellExecute("C:\Documents and Settings\All Users\Desktop\test3.bat", "", @ScriptDir, "")
            Case $msg = $GrpahsBID
                ShellExecute("C:\Documents and Settings\All Users\Desktop\test4.bat", "", @ScriptDir, "")
            Case $msg = $GpCID
                ShellExecute("C:\Documents and Settings\All Users\Desktop\test5.bat", "", @ScriptDir, "")
            Case $msg = $PCLID
                ShellExecute("C:\Documents and Settings\All Users\Desktop\test6.bat", "", @ScriptDir, "")
            Case $msg = $ECLID
                ShellExecute("C:\Documents and Settings\All Users\Desktop\test7.bat", "", @ScriptDir, "")
            Case $msg = $HOWID
                ShellExecute ("http://www.google.com.au")


        EndSelect
    Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID
EndFunc   ;==>_Main
Link to comment
Share on other sites

I did try it ... with comma

C:\Documents and Settings\Administrator\Desktop\test2.au3(52,49) : WARNING: $ExitID: possibly used before declaration.

Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Administrator\Desktop\test2.au3(52,49) : ERROR: $ExitID: undeclared global variable.

Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Administrator\Desktop\test2.au3 - 1 error(s), 1 warning(s)

Link to comment
Share on other sites

  • Developers

I did try it ... with comma

C:\Documents and Settings\Administrator\Desktop\test2.au3(52,49) : WARNING: $ExitID: possibly used before declaration.

Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Administrator\Desktop\test2.au3(52,49) : ERROR: $ExitID: undeclared global variable.

Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Administrator\Desktop\test2.au3 - 1 error(s), 1 warning(s)

.... and ?

The issue was solved and you now encountered another mistake in your script.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Right... :)

Could I get some tips how to solve this ?

I would say this error is pretty well described ... no?

you test for the content of $ExitID but where in your script is this variable defined?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Putting AutoItSetOption("MustDeclareVars", 1) at the top of your script will help you. Don't attempt to use vars before you declare and initialise them.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

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