Jump to content

au3check.exe in 3.3.8.1 throws random bogus error messages


Recommended Posts

for any given program that's about 1000 lines in length, au3check will throw improper errors that should not be there using default settings.

for instance, for the line

$btnEggTimerG = GUICtrlCreateButton("Set Egg Timer (&gas)", 280,              1*15+0*25+2*30, 130)
 

I get

D:prjkitchentimerkitchentimer-4.0timefuncs.au3(389,19) : ERROR: syntax error

in fact, for this working program that executes using kitchentimer.au3 I get:

D:prjkitchentimerkitchentimer-4.0timefuncs.au3(389,19) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(406,45) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(884,61) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(884,67) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(896,67) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(896,73) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(908,69) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(908,75) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(992,149) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(992,154) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(997,219) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(997,318) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1002,214) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1002,219) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1007,198) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1007,203) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1012,88) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1012,125) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1012,132) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1033,193) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1033,292) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1038,218) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1038,223) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1043,202) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1043,207) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1048,92) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1048,129) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1048,136) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1070,227) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1070,326) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1075,222) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1075,227) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1080,164) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1080,169) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1101,169) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1101,268) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1106,170) : ERROR: syntax error
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1106,175) : ERROR: multi-line 'If' missing 'Then'.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(167,42) : ERROR: $StringMid: undeclared global variable.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(180,26) : ERROR: $elapsed: undeclared global variable.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(1100,59) : ERROR: $dtimestr1: undeclared global variable.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(195,74) : ERROR: GregorianToJulian(): undefined function.
D:prjkitchentimerkitchentimer-4.0timefuncs.au3(429,29) : ERROR: Int64(): undefined function.
kitchentimergui.au3 - 43 error(s), 4 warning(s)

and when I clear most of those, it comes up with some more, so it's a never-ending stream.

please fix. thanks.

Link to comment
Share on other sites

  • Moderators

jmichae3,

AU3Check does not error that line for me. Please post your entire script - otherwise we cannot really help. :)

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

You have obviously got a serious syntax error. The actual error may be on a line previous to 389 but only become apparent when Au3check reaches line 389 and can not make sense of the information it has. All the errors reported after this are probably just a knock on effect of the first error. Fix that and the rest of the errors will go away.

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

I would argue that if the "lint" (au3check) program were doing its job correctly then I would get correct errors and not 50%-to-all bogus ones.

I have not used au3check before, but I have used other syntax checkers for other programs.

I can tell you something is broken in this syntax checker's parser. 

-w3 is a warning that's turned off by default because it's renders incorrect errors always due to not paying attention to variable scope.

normally, I would want all warnings on for most compilers because I want it as sensitive as possible. but I wonder about the ones that are by default off for this checker, so I am a little gun shy now of using anything but defaults on this syntax checker.

please fix. might take some work. I need better error messages. up until now, I have been relying on the error messages from running the script directly, e.g. double clicking or

C:> kitchentimergui.au3

which seems to be on-target.

if the script compiler were able to generate error messages and let me redirect to a file so I can grep for errors later, that's what I would be doing, but as such it doesn't. if I could use au3check reliably, I would be incorporating it into my build files as part of my build process.

kitchentimergui.au3

atoi64.au3

timefuncs.au3

shortbeep2.wav

Edited by jmichae3
Link to comment
Share on other sites

Here's your first error

if ($Mo >= 1 && $Mo <= 2) then

Replace && with And

Here's another error

local $Z = Floor($dtime/(1000*60*60*24))$JD+0.5

No clue what you're trying to do there though.

Here's another

$dtimestr=stringstripws($dtimestr,$tabpos+1),1+2+4)

You have a LOT of syntax errors in this script.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Moderators

jmichae3,

Firstly, I would like to point out that you paid nothing to download or use AutoIt - so the attitude you have taken so far in this thread is unliekly to make you many friends here. Personally I find AU3Check quite adequate for picking up syntax errors. ;)

Secondly, I have run the files you posted through AU3Check and timerfuncs.au3 is riddled with syntax errors - so it is hardly surprising that you get a lot of them flagged up. Here are just a few of the lines that draw errors:

if ($Mo >= 1 && $Mo <= 2) then ; Where do you find the && operator?

local $Z = Floor($dtime/(1000*60*60*24))$JD+0.5 ; What is the missing operator before $JD?

$dtimestr=stringstripws($dtimestr,$spacepos+1),1+2+4) ; Not even close to the correct syntax ;)

if ($_days_err) then msgbox(0,$PROGRAM_NAME,"oops days a """&Int(stringmid($dtimestr,1,$idays-1))&"_"&stringmid($dtimestr,1,$idays-1)&"""") endif ; What is EndIf doing at the end of a single line If statement?

if ($_ms_err) then msgbox(0,$PROGRAM_NAME,"oops ms a """&Int($dtimestr,$dot+1))&"_"&stringmid($dtimestr,$dot+1)&"""") endif ; Same problem - but also how many ) should there be after the Int parameters?
and the list goes on...and on...and on... :whistle:

So I suggest you stop badmouthing AutoIt and AU3Check and sort out your own abysmal code before posting anything at all in future. :)

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

If you have not used Au3Check, would have used TIDY?
Besides, so far what the editor, in which version you used?
 
 

I have not used au3check before, but I have used other syntax checkers for other programs.

 

I wonder what the other programs?
If the other program has so far been good, then why are you still not using it?
Is in the process of creating the script he's ever worked, when you start using AutoIt?
 
I wonder if the script you created from the start in AutoIt?
Maybe the script is the result of the conversion, such as converting from VisualBasic?
 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

The first error message:

D:prjkitchentimerkitchentimer-4.0timefuncs.au3(389,19) : ERROR: syntax error

points you to the line and the position within that line where the first syntax errors is.

  if ($Mo >= 1 && $Mo <= 2) then

I don't see how it could be much more specific as to what the error is. 

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

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