uncommon Posted August 29, 2013 Share Posted August 29, 2013 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. No problem can withstand the assault of sustained thinking.Voltaire _Array2HTMLTable(), _IEClassNameGetCollection(), _IEquerySelectorAll() Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 29, 2013 Moderators Share Posted August 29, 2013 uncommon,The "too big" line number is indeed because of the include files. I explain how to find the correct line number >here. M23 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...
NewPlaza Posted August 29, 2013 Share Posted August 29, 2013 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? Link to comment Share on other sites More sharing options...
uncommon Posted August 29, 2013 Author Share Posted August 29, 2013 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 More sharing options...
uncommon Posted August 29, 2013 Author Share Posted August 29, 2013 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? No problem can withstand the assault of sustained thinking.Voltaire _Array2HTMLTable(), _IEClassNameGetCollection(), _IEquerySelectorAll() Link to comment Share on other sites More sharing options...
BrewManNH Posted August 29, 2013 Share Posted August 29, 2013 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 GudeHow 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 More sharing options...
Moderators Melba23 Posted August 29, 2013 Moderators Share Posted August 29, 2013 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. M23 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...
uncommon Posted August 29, 2013 Author Share Posted August 29, 2013 (edited) 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. M23 Yes, that is the actual Obfuscated file, unless I did something wrong in the parameters. Here is a bigger screenshot. Edited August 29, 2013 by uncommon No problem can withstand the assault of sustained thinking.Voltaire _Array2HTMLTable(), _IEClassNameGetCollection(), _IEquerySelectorAll() Link to comment Share on other sites More sharing options...
Solution BrewManNH Posted August 30, 2013 Solution Share Posted August 30, 2013 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 GudeHow 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 More sharing options...
uncommon Posted September 1, 2013 Author Share Posted September 1, 2013 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 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