Jump to content

Recommended Posts

Posted

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?

  • Moderators
Posted

supadodger,

Dog eaten your Help file? ;)

Try @ScriptLineNumber.

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

 

  • Moderators
Posted

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

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

 

  • Moderators
Posted

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

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

 

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...