Jump to content
Funtime60

Error line outside written code

Recommended Posts

Funtime60

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 B) 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

Share this post


Link to post
Share on other sites
JLogan3o13

@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 ;)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Melba23

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 by Melba23

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
Funtime60
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.

Share this post


Link to post
Share on other sites
Funtime60

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.

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

×