Jump to content

Error line outside written code


 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

@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

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...