Sign in to follow this  
Followers 0
supadodger

Creating An Error Checking Line Number Automatically?

8 posts in this topic

i have a bunch of code like this

If Not IsArray ($blah) Then
MsgBox(0,"","Array Error On Line 95")
EndIf

the problem is everytime i make changes to the script i have to go edit every one of them MsgBox With the new line number of the script.

is there anything built in that i can use to automate this?

Share this post


Link to post
Share on other sites



supadodger,

Dog eaten your Help file? ;)

Try @ScriptLineNumber.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Remark: will not work when compiled.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Hey,

He can read that bit for himself! ;)

Besides debugging should come before compilation - although looking at the number of "Error on Line -1" posts it is not a common trait. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

I don't suppose a #CurrentLineNum compiler directive that gets replaced at compile/runtime is within the realm of possibility, maybe?

Share this post


Link to post
Share on other sites

willichan,

The more recent AutoIt releases will tell you which line of the compiled script caused a fatal error, but you need to use the script produced by Obfuscator with the /StripOnly directive to be able to determine the actual line. This is because the "compiled" script also contains all the includes and hss the blank lines and comments stripped. ;)

It works well using these directives:

#AutoIt3Wrapper_Run_Obfuscator=y

#Obfuscator_Parameters=/so

If you just want to know where you are in the compiled script, then you could use the _DeBug* commands - you have to mention where you are rather than use the @ScriptLineNumber macro, but it is still pretty useful. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I don't suppose a #CurrentLineNum compiler directive that gets replaced at compile/runtime is within the realm of possibility, maybe?

This Is What i was hoping existed....

i just made another script that i run on every script ahead of time to update the line numbers...

Besides debugging should come before compilation - although looking at the number of "Error on Line -1" posts it is not a common trait.

i know debugging should happen before compile but lets say im doing a _stringbetween on an ie attach which the page doesnt load i want the person i send the compiled script to be able to tell me where the error occured so i can try to figure out why its not loading.

thanks anyway guys. i was just hoping for something like this to make my life simpler.

Edited by supadodger

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
Sign in to follow this  
Followers 0