Sign in to follow this  
Followers 0
obrienj

Determining real line number in script

3 posts in this topic

#1 ·  Posted (edited)

I have a 1412 line script with about 20 includes.

On rare occasions Autoit pops an error message box telling me that an "array index is out of range" or some such and terminates the script just as it should.

However, the error message references line 9216 which I guess is a line in my code after all of the includes are pre-pended.

Is there a way to either (1) save the intermediate source (after includes are resolved), (2) dis-assemble the .exe to see all lines of code, or something else so I can see exactly where the error is.

Regards,

Jim

Edited by obrienj

Share this post


Link to post
Share on other sites



obrienj,

When compiling your script, run Obfuscator using the /STRIPONLY parameter. That way the compiler uses an au3 file which has the include files included, but all unused functions, variables, comments and blank lines removed. It is saved in the same folder as the source and named YourScriptName_Obfuscated.au3. You need to add these directives to the top of your script:

#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/so

Then when the error occurs, it is easy to see which line gave the fault as it is this Obfuscated file which has been compiled - just scroll to the indicated location. The only problem we know of is that using the line continuation operator screws up the count, but apart from that it works fine. :mellow:

Of course, you need the full SciTE4AutoIt3 package, which you can download from here if you do not already use it. :)

M23

1 person likes this

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

When compiling your script, run Obfuscator using the /STRIPONLY parameter. That way the compiler uses an au3 file which has the include files included, but all unused functions, variables, comments and blank lines removed. It is saved in the same folder as the source and named YourScriptName_Obfuscated.au3. You need to add these directives to the top of your script:

Great! I was just going to post about this, since I'm having exactly the same problem.

It's a shame we can't get stacktraces and source-accurate line numbers (when using the compiler). Maybe there's a way to instrument the code with debugging markers to roll your own stack trace?

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