Funtime60 Posted November 17, 2017 Share Posted November 17, 2017 I'm getting an error on that says there is an error at line 7000 something. There are two major problems here, A) this worked early although it was a different machine, and my code is only 61 lines long. Any clues as to what's going on? (Please excuse any stupid things I wrote in here. I bet there's a lot.) Chat.au3 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 17, 2017 Moderators Share Posted November 17, 2017 @Funtime60 the difference in lines is due to your includes, as all of those lines are counted too. The best way to narrow down errors is through good coding practices. This would include proper error checking after every action. Below is just a short example of this inside your script: Local $CoFPath, $CoFile, $Config $CoFPath = @WorkingDir & "\Settings.cfg" If FileExists($CoFPath) Then $CoFile = Fileopen($CoFPath, $FO_READ) Else ConsoleWrite("Unable to open " & $CoFPath & @CRLF) EndIf Writing your script in this manner allows you to track down issues much more quickly, and the line number become irrelevant "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 17, 2017 Moderators Share Posted November 17, 2017 (edited) Funtime60, The include lines you have at the top of your script actually insert the entire include file at that point - so your script does not start until many, many lines later than you think. Look in the SciTE Help file for Au3Stripper with the /MergeOnly option - that gives you a file similar to the one used to compile and allows you to determine which line is giving you the problem. My guess: the StringSplit on line #40, because you will crash if you try to access a non-existent array. So add some errorchecking to confirm you have a valid array after the function call. M23 Edit: Which is what he just said as well! Edited November 17, 2017 by Melba23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Funtime60 Posted November 17, 2017 Author Share Posted November 17, 2017 4 minutes ago, JLogan3o13 said: @Funtime60 the difference in lines is due to your includes, as all of those lines are counted too. The best way to narrow down errors is through good coding practices. This would include proper error checking after every action. Below is just a short example of this inside your script: Local $CoFPath, $CoFile, $Config $CoFPath = @WorkingDir & "\Settings.cfg" If FileExists($CoFPath) Then $CoFile = Fileopen($CoFPath, $FO_READ) Else ConsoleWrite("Unable to open " & $CoFPath & @CRLF) EndIf Writing your script in this manner allows you to track down issues much more quickly, and the line number become irrelevant 2 minutes ago, Melba23 said: Funtime60, The include lines you have at the top of your script actually insert the entire include file at that point - so your script does not start until many, many lines later than you think. Look in the SciTE Help file for Au3Stripper with the /MergeOnly option - that gives you a file similar to the one used to compile and allows you to determine which line is giving you the problem. My guess: the StringSplit on line #40, because you will crash if you try to access a non-existent array. So add some errorchecking to confirm you have a valid array after the function call. M23 Edit: Which is what he just said as well! Thank you so much! Quick question though, why would line 40 cause it to have a problem with while? My error says that my While is missing a Wend. Link to comment Share on other sites More sharing options...
Funtime60 Posted November 17, 2017 Author Share Posted November 17, 2017 I'M AN IDIOT! Line 33 starts an external program. Said external program is also written in Autoit. Said external Autoit program may not have possessed a complete While statement at the latest compiling. Oops. Sorry for wasting your time. 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