Hasher Posted August 2, 2016 Share Posted August 2, 2016 Ok so I have autoit app which runs in a compiled state . About every 10th time it runs it throws up an error "Line 5129 : Error in Expression" . Problem is I can't recreate the error un-compiled . I have a error function but it doesn't seem to catch the error. Any suggestions for hunting down this error? My Error check : Global $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") Func MyErrFunc($oMyError) Local $HexNumber Local $strMsg $HexNumber = Hex($oMyError.Number, 8) $strMsg = "Error Number: " & $HexNumber & @CRLF $strMsg &= "WinDescription: " & $oMyError.WinDescription & @CRLF $strMsg &= "Script Line: " & $oMyError.ScriptLine & @CRLF MsgBox(0, "ERROR", $strMsg) SetError(1) Endfunc Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of shhh extensions! Link to comment Share on other sites More sharing options...
InunoTaishou Posted August 2, 2016 Share Posted August 2, 2016 I have no idea where the error could be because I have no idea what your code looks like. Link to comment Share on other sites More sharing options...
Hasher Posted August 2, 2016 Author Share Posted August 2, 2016 It's over 800 lines of code , I am trying to narrow it down Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of shhh extensions! Link to comment Share on other sites More sharing options...
AutoBert Posted August 2, 2016 Share Posted August 2, 2016 Yes have a look on this small script: #include <Array.au3> local $sFile1 = @scriptdir & '\file2.txt' Local $aResult=StringSplit(StringStripWS(StringReplace(StringReplace(StringReplace(FileRead('file2.txt'),@CRLF,' '),@TAB,' '),',',' '),7),' ',3) For $i=0 To UBound($aResult) ConsoleWrite($i&': '$aResult[$i]) Next _ArrayDisplay($aResult) the error is in line 7. But there is one include, so linenumber in exe not 7. Using au3stripper with param /mo i get this file: test_stripped.au3 The exe throw's error: Yet, having a look in the stripped au3 file what's in line will get result: ConsoleWrite($i&': '&$aResult[$i]) Hasher 1 Link to comment Share on other sites More sharing options...
InunoTaishou Posted August 2, 2016 Share Posted August 2, 2016 I believe these wrappers will create a .au3 file so the line of the error shown on the compiled matches the .au3 file #AutoIt3Wrapper_Run_Tidy=n #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/MO Then you'll see where the error should be. Link to comment Share on other sites More sharing options...
Developers Jos Posted August 2, 2016 Developers Share Posted August 2, 2016 yes, but only when you have the full version of SciTE4AutoIt3 installed! You can then have a look at the Scriptfilename_stripped.au3 generated file for the correct line. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
SadBunny Posted August 2, 2016 Share Posted August 2, 2016 Am I missing something or is it just an array subscript out of range thing? Change: For $i=0 To UBound($aResult) ... to: For $i=0 To UBound($aResult)-1 ... because let's say $ar holds three elements, then UBound($ar) will be 3, but you have elements [0], [1] and [2], but NOT [3]. Your loop loops from zero to three (0 to UBound($ar)) so when it gets to three, it will break. Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
AutoBert Posted August 2, 2016 Share Posted August 2, 2016 30 minutes ago, SadBunny said: Am I missing something or is it just an array subscript out of range thing? It's just a demostration script (with error: array subscript out of range ). Read https://www.autoitscript.com/forum/topic/183884-annoying-error/?do=findComment&comment=1320787 and you will understood. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now