timmy2

How do I track down an error visible only in compiled exe?

3 posts in this topic

#1 ·  Posted (edited)

My script has this directive (#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6) at the top.  When I run the script from SciTE the results are what I expect and no errors are generated.  When I run the compiled executable I still get what I expect results-wise, but at the very end an AutoIt Error appears: "Error: Variable used without being declared". It cites a line number far out of range of my actual code, though perhaps it is referring to an included UDF.

What can I do to more accurately simulate running the exe in SciTE so I can track down the undeclared variable? I suspect it's a UDF because I've added a couple recently.

Thank you.

Edited by timmy2
make title more specific

Share this post


Link to post
Share on other sites



Use Au3Stripper with option /mo.
"That just merges the Include files into the source and strips the Comments. This is similar to aut2exe and helps finding the errorline."


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

timmy2,

Or you could post your code so we can run it and see if we can reproduce the problem.

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

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

    • argumentum
      By argumentum
      #NoTrayIcon If @Compiled Then Exit MsgBox(262144, @ScriptName, "run this test from SciTE" & @CR & "this is just a test", 5) #include <WinAPI.au3> ; for _WinAPI_FindWindow #include <Misc.au3> ; for _IsPressed If StringInStr($CmdLineRaw, "DoACrash") Then DoACrash() Func DoACrash() Local $a = "caca" $a[1] = "more caca" EndFunc ;==>DoACrash Run('"' & @AutoItExe & '" "' & @ScriptFullPath & '" DoACrash') ; to create the initial crash catchTheCrash() Func catchTheCrash() AutoItWinSetTitle("if this window not found, then, a crash catcher is wanted ???") Local $hDLL = DllOpen("user32.dll") Local $w, $t = TimerInit() While 1 ToolTip("press and hold ""ESC"" to exit." & @CR & "loop time: " & Round(TimerDiff($t)) & " mSec.") $t = TimerInit() Sleep(20) If _IsPressed("1B", $hDLL) Then Exit 0 ; ESC key $w = _WinAPI_FindWindow("#32770", "AutoIt Error") ; very fast, does not affect CPU much If $w Then WinSetState($w, "", @SW_HIDE) ; all these are slow. Is there a faster way to not show the MsgBox ? ConsoleWrite("--- " & @MIN & ":" & @SEC & "." & @MSEC & @CRLF & _ ControlGetText("AutoIt Error", "", "Static2") & @CRLF) WinClose($w) Run('"' & @AutoItExe & '" "' & @ScriptFullPath & '" DoACrash') ; ..to keep on crashing ;) EndIf WEnd EndFunc ;==>catchTheCrash is there a faster way to get the info. and close the MsgBox ?