Jump to content

How to handle autoit crash


 Share

Recommended Posts

Hi there

Is there someway for me to make this Posted Image

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 file

Cheers

/Rex

Link to comment
Share on other sites

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

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.

Hi

I 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

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 :mellow: 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 :lol:

Cheers

/Rex

Link to comment
Share on other sites

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 :mellow: 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

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