Jump to content

Recommended Posts

Posted

Hi,

i need something similar to try/catch, but most likely i am coding wrong, because when the error occurs won't be "managed".

 

My code is:

 

$first_index=$Entry_to_Delete_Indexes_2[0]

If @error Then
    Diagram_for_last_day($aFile_Array_Original, $Day_To_Delete)
EndIf

 

If the assignment gives an error because the array-element is not valid, it should launch a function. This is my goal.

 

But the error comes and the program exits.

How should i write this "exception"?

 

  • Developers
Posted

Test that before you use it in case you want to know for sure.

use IsArray() to check whether it is an Array and use UBound() to determine whether the index number is available.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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
×
×
  • Create New...