Jump to content

finding an error


Go to solution Solved by BrewManNH,

Recommended Posts

I get an error after performing a function. But the error only displays the line of code where the error happened. Not in the specific file. I don’t have that many lines of code in my script which leads me to believe that the error line is with all the #includes compiled together.

How do I find where this error is happening? It’s partially troublesome because it only happens sometimes. Suggestions please.

 

error.png

No problem can withstand the assault of sustained thinking.Voltaire

_Array2HTMLTable()_IEClassNameGetCollection()_IEquerySelectorAll()

Link to comment
Share on other sites

  • Moderators

uncommon,

The "too big" line number is indeed because of the include files. I explain how to find the correct line number >here. ;)

M23

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

Melba23, thanks, I will look into this futher.

Can't you double click the error from within scite and it will jump to the include file at the line it's reporting the error?

NewPlaza, I have not been able to reproduce the problem on my own PC. I only find it occationally on certain client PC. And I have not been able to determin what the computers have in common.

Thankyou both.

No problem can withstand the assault of sustained thinking.Voltaire

_Array2HTMLTable()_IEClassNameGetCollection()_IEquerySelectorAll()

Link to comment
Share on other sites

uncommon,

The "too big" line number is indeed because of the include files. I explain how to find the correct line number >here. ;)

M23

I looked into this link, compiled the script with Obfuscator with the /STRIPONLY parameter and

#AutoIt3Wrapper_Run_Obfuscator=y

#Obfuscator_Parameters=/so

 Added to the region.

However, the script still ends far before the indicated error. (Refer to the screenshot above and then below) Note that I have tried compiling in production and in the beta and error still occurs intermittently

Other solutions?

 

2013-08-29_1634.png

No problem can withstand the assault of sustained thinking.Voltaire

_Array2HTMLTable()_IEClassNameGetCollection()_IEquerySelectorAll()

Link to comment
Share on other sites

Add this line to the top of your script and run Au3Check on the script and see if anything is reported.

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 6

If you're getting an undeclared variable error, that SHOULD pick it up. If it doesn't then you should run through your script line by line following the flow of the code until you can find where you're using a variable name before you've actually declared it. Such as something like this "$c = $c + 1" and you haven't declared $c with a value yet.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Moderators

uncommon,

Are you looking at the obfuscated file (which contains all the includes) or your original script? The obfuscated file is named YourScriptName_Obfuscated.au3 and should be in the same folder. :huh:

M23

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

Add this line to the top of your script and run Au3Check on the script and see if anything is reported.

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 6

If you're getting an undeclared variable error, that SHOULD pick it up. If it doesn't then you should run through your script line by line following the flow of the code until you can find where you're using a variable name before you've actually declared it. Such as something like this "$c = $c + 1" and you haven't declared $c with a value yet.

Most of the time the editor is good at catching error like that, but it won’t catch If Then conditions where a variables may or may not be declared under certain circumstances.

I will look into this more tomorrow thanks for the input.

 

uncommon,

Are you looking at the obfuscated file (which contains all the includes) or your original script? The obfuscated file is named YourScriptName_Obfuscated.au3 and should be in the same folder. :huh:

M23

Yes, that is the actual Obfuscated file, unless I did something wrong in the parameters.

Here is a bigger screenshot.

2013-08-29_1938.png

Edited by uncommon

No problem can withstand the assault of sustained thinking.Voltaire

_Array2HTMLTable()_IEClassNameGetCollection()_IEquerySelectorAll()

Link to comment
Share on other sites

  • Solution

Variables should NEVER be declared conditionally if you're going to use them elsewhere.

By the way, posting screenshots of your script aren't helping us help you very much. Post your script and things would be a lot easier.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Variables should NEVER be declared conditionally if you're going to use them elsewhere.

By the way, posting screenshots of your script aren't helping us help you very much. Post your script and things would be a lot easier.

Funny you say that because as soon as was about to post the code. I was looking around the functions where the progress bar was 100% and I noticed a variable that would not have been declared under the circumstances of the screenshot. I think the AU3check setting helped narrow it down.

I was trying to avoid posting the code sense I could not make a small reproducer, but I can still post it if you wanna see it.

No problem can withstand the assault of sustained thinking.Voltaire

_Array2HTMLTable()_IEClassNameGetCollection()_IEquerySelectorAll()

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