Jump to content

Errors in the wrong line


Darien
 Share

Recommended Posts

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?

teste.au3

Link to comment
Share on other sites

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]
MsgBox(0,"",$a[1])

You see it shows line 2 is your error

 

and to remove the rror

dim $a = [""]
MsgBox(0,"",$a[0])

;or 

dim $a[1]
MsgBox(0,"",$a[0])

;or 

dim $a[2]
MsgBox(0,"",$a[1])

 

Edited by IanN1990
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

×
×
  • Create New...