JoachimR

Line Numbers in AutoIt Error Messages

14 posts in this topic

Does anybody have a suggestion on how I can get the reported line number (here "Line 17266") for an AutoIt runtime error
in a compiled program converted to something more useful? The line number is obviously due to the concatenation of all referenced
includes. Maybe there is a way to get a base number for the real program?

error.PNG

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

  JoachimR.

Use Au3Stripper with the /MergeOnly flag to get the file as passed to Aut2Exe - then the line numbers will match. See SciTE help for more full details.

But better still - debug the script and prevent the error by adding some form of errorchecking code.

M23

Edited by Melba23
Added advice!
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

I got an error message on a program that has only 6692 lines of script - sent to me by a colleague. Line 12068 Error: Variable used without being declared.

I tried running Au3Stripper and got the following error

- ### C:\Program Files (x86)\AutoIt3\SciTE\Au3Stripper\Au3Stripper.dat missing... Please get it from the website to make sure the Au3Stripper will work correctly.

Where do I get this file?

I got a stripped file but it deleted 11 of my functions, not all, and then complained that they weren't there.. Will the dat file fix that?

Blessings

Graeme

Share this post


Link to post
Share on other sites

How did you install au3stripper and how are you running it?

You haven't followed the instruction given in Melba23's post when Funcs/Variables are removed.

On 9/29/2015 at 6:28 PM, Melba23 said:

Use Au3Stripper with the /MergeOnly flag

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I thought I answered this...

I ran Au3Stripper from within the Compile dialogue.

It was already installed but it seems to lack the dat file and suggests that I get this from the website..

Graeme

Share this post


Link to post
Share on other sites

Well, when the dat file is missing it can only mean something go missing as the installer puts it in the right spot.
Try re-installing the Full SciTE version with the installer and ensure you run it with your regular account as files are copied to your %LOCALUSERDATA% directory.

Jos

 


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I reinstalled SciTE and reran Au3Stripper and got the following on the console.  I installed and ran it in the same account.

Running Au3Stripper (15.920.938.0)  from:C:\Program Files (x86)\AutoIt3\SciTE\Au3Stripper cmdline:
- ### C:\Program Files (x86)\AutoIt3\SciTE\Au3Stripper\Au3Stripper.dat missing... Please get it from the website to make sure the Au3Stripper will work correctly.
+> 0 Au3Stripper v15.920.938.0 finished merging 22142 lines of code, stripped 9659 comment lines and Merged 343 Continuation lines.
+>        Created:U:\Documents\*****\QA files\QuickAccess2.3.4\QuickAccess2.3.4 To strip_stripped.au3 with 12140 lines.
+>12:29:13 Au3Stripper ended.rc:0

I then had 13 undefined functions which ran well in the unstripped version.

When I compile without the /MergeOnly setting it compiles without error.

Blessings

Share this post


Link to post
Share on other sites

I found Au3Stripper.dat in my Admin user account - to install the SciTE you have to change to user of course... I copied it to the C:\Program Files (x86)\AutoIT3\SciTE\Au3Stripper folder and it worked - better.

Then I realised that the point where it was dropping functions was where I found

#ce______________________________________________________________

and I changed it to

#ce ______________________________________________________________

and it worked better.

It only had one function dropped.

Then I found #_____________________________________________________

I deleted this and now it works. I think these may have been options that used to work and now don't - at least as far as Au3Stripper is concerned -

Fixed:) Thanks for all your comments!

Blessings

Graeme

Share this post


Link to post
Share on other sites

I always imagined that when the program is loaded into memory, anything that gets loaded externally is placed in there as well. Aside from includes, I mean if you are reading from another file or data source. Most of the times I ever see line numbers well beyond what is actually present in the EXE is when the program creates an array.

Share this post


Link to post
Share on other sites
On 9/29/2015 at 0:28 PM, Melba23 said:

  JoachimR.

Use Au3Stripper with the /MergeOnly flag to get the file as passed to Aut2Exe - then the line numbers will match. See SciTE help for more full details.

But better still - debug the script and prevent the error by adding some form of errorchecking code.

M23

I've always wondered about this issue. Thanks for pointing this out.


My Scripts:

False Positive Reporter - Mass email all anti virus vendors with an attachment of your program for easy whitelisting.

PortableApps.com App Creation Wizard  - A simple GUI-based Wizard for creating PortableApps.

AutoISO  - Automatic ISO Image creation using ImgBurn.

SoundBoard - Play any song or sound you want at the press of a hotkey

Share this post


Link to post
Share on other sites

Did anyone notice that Au3Stripper handled #________________________________________ and #ce___________________________________ differently from Au2exe?

Could this be classed as a bug in Au3Stripper?

I know I had problems once before where the compiler would compile the program which would run but if I ran it with SciTE it would produce errors..:( This was because of lines that were #_____________________________________________________________ which were used, erroneously(?) to divide the script up, as far as I could see.

Blessings

Graeme

Share this post


Link to post
Share on other sites

Lol you double posted. If the bug does not already exist (check here and here) then report the bug.


My Scripts:

False Positive Reporter - Mass email all anti virus vendors with an attachment of your program for easy whitelisting.

PortableApps.com App Creation Wizard  - A simple GUI-based Wizard for creating PortableApps.

AutoISO  - Automatic ISO Image creation using ImgBurn.

SoundBoard - Play any song or sound you want at the press of a hotkey

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

    • MvGulik
      By MvGulik
      ;; suggested filename: "SplitLineMerge.au3" ;; Just run(build) it on it self to test it. (SciTe4AutoIt3) ;; Generally tested. (possible rare exceptions ignored.) ;; ... Not intended to be used on none Obfuscated au3 files. ;; include these 3 lines in your source code. (with <foobar> parts adjusted to your situation.) #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/so #AutoIt3Wrapper_Run_After=<Filespec_To_AutoIt3.exe, (not accepting quotes:?)> /AutoIt3ExecuteScript "<Path_To>\SplitLineMerge.au3" "%in%" DebugOut('>Running: Obfuscated_SplitLineMerge, CMD: ' & $CmdLineRaw) If Not $CmdLine[0] Then DebugOut_Exit('!>No CmdLine input.', 1) If Not IsFile($CmdLine[1]) Then DebugOut_Exit('!>Target source file not found.', 3) _SplitLineMerge($CmdLine[1]) Exit Func _SplitLineMerge($sFile_Au3) If StringRight($sFile_Au3, 4) <> '.au3' Then _ DebugOut_Exit('!>Target file not a ".au3" file.', 4) Local $sFile_Source = StringTrimRight($sFile_Au3, 4) & '_Obfuscated.au3' If Not IsFile($sFile_Source) Then _ DebugOut_Exit('!>Target "*_Obfuscated.au3" file not found.', 5) Local $sCode = FileRead($sFile_Source) $sCode = StringReplace($sCode, ' _' & @CRLF, ' ', 0, 2) Local $iCount = @extended Local $sFile_Target = StringTrimRight($sFile_Source, 4) & '_MergedSplitLines.au3' If FileExists($sFile_Target) And Not FileExists($sFile_Target & '\') And Not FileDelete($sFile_Target) Then _ DebugOut_Exit('!>FileDelete "' & $sFile_Target & '" failed.', 6) If Not FileWrite($sFile_Target, $sCode) Then _ DebugOut_Exit('!>FileWrite "' & $sFile_Target & '" failed.', 7) DebugOut('+>"' & $sFile_Target & '" file written, ' & $iCount & ' lines merged.') EndFunc Func IsFile($sFile) Return FileExists($sFile) And Not FileExists($sFile & '\') EndFunc ;; --- Func DebugOut($1, $2 = 'fOObAr') If Not ($2 == 'fOObAr') Then $1 &= ' = ' & String($2) Return ConsoleWrite($1 & @CRLF) EndFunc Func DebugOut_Exit($1, $2 = 0) ConsoleWrite($1 & @CRLF) Exit $2 EndFunc (Edits: Title adjust, Title adjust 2, ...)