Errors in the wrong line

4 posts in this topic

When an error occurs in a compiled script, the line number where the error occurred does not match. I noticed that blank lines and lines with only comments are ignored. in the attached example, it is advised that the error occurred on line 2, although in line 4. How to make it warned the correct line?


Share this post

Link to post
Share on other sites

#2 ·  Posted (edited)

If my understanding is correct, when you compile code it removes spaces / lines and everything "Human" about scripting. As to computers its wasted space


So line 4 becomes line 2 


If you compile this

dim $a [1]

You see it shows line 2 is your error


and to remove the rror

dim $a = [""]


dim $a[1]


dim $a[2]


Edited by IanN1990

Share this post

Link to post
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

  • Similar Content

    • aiter
      By aiter
      Anyone knows how to download the graphical autoitdebugger
      The download appears to have upped and died.
      Or an alternative?
    • valdemar1977
      Dbug - another debugger for AutoIt
      By valdemar1977
      Dbug is graphical debugger for AutoIt.
      Project started by @Heron in 2009 and now supported by @asdf8 and @valdemar1977
      Debug the complete script or just parts of it Display run status (line number of currently executed function) GUI default always-on-top in the upper right corner for comfortable debugging WM_NOTIFY and WM_COMMAND hook to prevent interference with possible message handlers Display scope, type and value of variables, expressions, macro's and constants (global AND function local) Execute commands in an immediate window. Can be expressions, functions and assignments Detailed display of array, struct and object variables Dynamic display of variable value in the source code (under cursor) Array table viewer with ability to view the sub-arrays, the correct handling of macro @Error, @Extended and other changes OEM and ANSI console output Conditional breakpoints Saving settings and debugging state and much more...
    • Simpel
      [Solved] SciTE no functions working
      By Simpel
      I updated to the last version. Since then a lot of functions are not working.  For instance expanding abbreviation. My au3abbrev.properties are correct and abbrev.properties are including both import lines. The abbreviation is red but won't expand. Neither with space nor Ctrl+B.
      Debug to msgbox and console not working, list functions, jump to function, open include too.
      SciTE Jump works. Block and box comment too.
      I have the feeling all functions especially for autoit are not working.
      Any help? Regards, Conrad
    • Reizvoller
      ImageSearch Script Closing w/ Error
      By Reizvoller
      I am back once again to ask for assistance. I am just trying to fool around with the "ImageSearch" function in order to detect when certain elements appear on my active window to then respond to. To begin testing this I simply cut out a small segment of my background, saved it as a BMP, and used that as the bmp for the search function. I had hoped for it to just run through quickly and say it found it and spit out the X Y coords of where it was found. Instead I am getting this : http://screencast.com/t/MD9aOzPhETE
      Here's my script thus far :
      #Include <msgBoxConstants.au3> #Include <ImageSearch.au3> global $x = 0 global $y = 0 CheckForImage () Func checkForImage () Local $Search = _ImageSearchArea ('ninjaCheck.bmp', 1, 0, 0, 1366, 768, $x, $y, 100) If $Search = 1 Then MsgBox ($IDOK,"Found",$resultPosition) EndIf EndFunc While 1 Sleep (10) WEnd What I would like assistance with is how do I "Debug" this in order to see where/why it is failing.
      I've reviewed https://www.autoitscript.com/wiki/FAQ#How_can_I_debug_my_script.3F but I am not entirely sure how to apply the information. If I could get a return on "Hey, this Func or This Line is where I died" , that would be awesome.
      Any suggestions on how I can tackle this issue?
      Thank you for your time!
      checkNinja.bmp is " " around it now and it has the same result 
    • Valnurat
      By Valnurat
      How is it possible to debug your code?