Jump to content

A small bug


logmein
 Share

Recommended Posts

Func _exit () IniWrite(@SystemDir & "ImageConverter.ini", "Settings", "Dir1", GUICtrlRead($s))
    IniWrite(@SystemDir & "ImageConverter.ini", "Settings", "Dir2", GUICtrlRead($d))
 Exit ()
EndFunc

the au3check say : syntax error!

Link to comment
Share on other sites

Okay our errors:

d:\my documents\ABC.au3(4,8) : ERROR: syntax error
    Exit ()
    ~~~~~~^

So now lets skip straight to the help file.

Lets look at Exit.

We read the freaking document and then we see it...

The parameter, if included, can be enclosed in parentheses. Thus, the following are equivalent: Exit, Exit 0, and Exit(0). However, Exit() is invalid.

Now tell me why the hell you couldn't work that out? Seems fairly simple if your debugging...

Also use the full version of SciTE if you're not already. Link is in my sig.

Cheers,

Brett

Link to comment
Share on other sites

  • Moderators

logmein,

Au3Check tells you more than that! In both the console and the Au3Check Errors message box it tells you exactly what is wrong. What does it say?

M23

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

As Brett pointed out, your exit was all wrong. Also, I dont know if it was intended, but your not meant to have code on the same line as your functions first line.

Func _exit () ; Put nothing on this line after the brackets are closed.
    IniWrite(@SystemDir & "ImageConverter.ini", "Settings", "Dir1", GUICtrlRead($s))    
    IniWrite(@SystemDir & "ImageConverter.ini", "Settings", "Dir2", GUICtrlRead($d))
 Exit 
EndFunc

Thats all the problems findable in the given code, but as Melba23 said, your Au3Check is a lot more descrptive than just saying "Syntax Error". Read it fully and go over your code to see if you can find any more problems, double clicking the error will take you right to the line, it even shows you the character where the problem has been found... =P

Still learning...I love autoit. :)

Link to comment
Share on other sites

if you want it to exit after the iniwrtite place EXIT (not EXIT()) beneath the iniwrites on its own line :)

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