Rex Posted March 9, 2010 Share Posted March 9, 2010 Hi thereIs there someway for me to make this to show my own msg ? some how, i only want one msg for all errors i not already have an error handle on.And now where the runerrorsfatal is removed i don't know how to either remove or change the error msg.And i can't calc for all errors that would apera if user removes/changes some critical info from my ini fileCheers/Rex Link to comment Share on other sites More sharing options...
Fire Posted March 9, 2010 Share Posted March 9, 2010 I know only one way.Editing your output.exe`s this sections with Reshacker. [size="5"] [/size] Link to comment Share on other sites More sharing options...
MHz Posted March 10, 2010 Share Posted March 10, 2010 If runerrorsfatal still existed, then that would not help you with that error as it is because your script is trying to use an array element/subscript that does not exist (also known as out of bounds, or as the error Messagebox says). The Ubound() function exists so that your script can use it to determine the size of the array so that your code knows the bounds. Your array handling code is incorrect so you get this error message showing. You need to fix the array handling to stop your script from crashing. I do not understand why you cannot handle the information within the ini file from the string/error handling in your script. Perhaps it is like your array code as being inadequate with the handling of it. So fix it so it does handle the information correct and no more problems. Look in the help file for "Command Line Parameters" and the usage of "/ErrorStdOut" and that may allow your script to crash with no visual error warning. Link to comment Share on other sites More sharing options...
Rex Posted March 10, 2010 Author Share Posted March 10, 2010 I know only one way.Editing your output.exe`s this sections with Reshacker.I think that it would over killing it Cheers/Rex Link to comment Share on other sites More sharing options...
Rex Posted March 10, 2010 Author Share Posted March 10, 2010 If runerrorsfatal still existed, then that would not help you with that error as it is because your script is trying to use an array element/subscript that does not exist (also known as out of bounds, or as the error Messagebox says).The Ubound() function exists so that your script can use it to determine the size of the array so that your code knows the bounds. Your array handling code is incorrect so you get this error message showing. You need to fix the array handling to stop your script from crashing.I do not understand why you cannot handle the information within the ini file from the string/error handling in your script. Perhaps it is like your array code as being inadequate with the handling of it. So fix it so it does handle the information correct and no more problems.Look in the help file for "Command Line Parameters" and the usage of "/ErrorStdOut" and that may allow your script to crash with no visual error warning.HiI have error controle on my arrays, but only "if @error then msg something"What i'm trying to prevent is my script crasing if the user deletes something in my ini file, and yes i know to user stupidy theres no way telling.....Cheers/Rex Link to comment Share on other sites More sharing options...
water Posted March 10, 2010 Share Posted March 10, 2010 The best cure against user stupidy is error checking and error checking and ... If your script crashes because a user deleted a key from the ini file then do the iniread and then check for complete and correct keys and data. Good programming style is to check for (as much as possible) user errors so you don't have to copy with error messages like the one you showed. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki  Link to comment Share on other sites More sharing options...
Alek Posted March 10, 2010 Share Posted March 10, 2010 I usally use if ubound($Array) < $Expected_Array_Size then ;Handle array error endif PS: "Line 12734" Holy crap!!!! [font="Impact"]Never fear, I is here.[/font] Link to comment Share on other sites More sharing options...
Rex Posted March 10, 2010 Author Share Posted March 10, 2010 I usally use if ubound($Array) < $Expected_Array_Size then ;Handle array error endif PS: "Line 12734" Holy crap!!!! Could be that i should do the ubound thing on my arrays, but damn that will take forever i use lots of arrays in my prog. "Line 12734" is that a lot? Last i checked my code was > 8800 lines, including comments, prog/func descriptions and a few #cs / #ce and that only my own code then there is all the includes i use Cheers /Rex Link to comment Share on other sites More sharing options...
Rex Posted March 10, 2010 Author Share Posted March 10, 2010 The best cure against user stupidy is error checking and error checking and ...If your script crashes because a user deleted a key from the ini file then do the iniread and then check for complete and correct keys and data.Good programming style is to check for (as much as possible) user errors so you don't have to copy with error messages like the one you showed.U'r right, i just think that i'm too lazy to do'it when i write my code the first time course checking all my inputs (from ini files) would i think add > 200-300 lines of extra code to my script Cheers/Rex Link to comment Share on other sites More sharing options...
Juvigy Posted March 10, 2010 Share Posted March 10, 2010 You could add error handlers.Check in the help file.Also you can check the INI file before using it as suggested above. Using Reshacker is not needed.Also dangerous if not experienced. 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