D
Don Starnes
I am trying to set values in a global, multidimensional array variables when
some forms open. The forms call a procedure in a module tests to see if the
arrays have values; if not, it Redims them and sets their values. The values
are used often throughout my application.
I use Ubound(array, 1) to test if the array has values. If the array has not
been Redimmed and it’s values haven’t been set, Ubound gives a “subscript out
of range†error. I test for the error with On Error Goto mylabel; at mylabel:
there is code for filling the arrays.
Often (but not always), the On Error fails to trap the error and throws the
error back to the procedure that called it, skipping the label and thus not
filling an array.
The problem seems to be how to test for values in an array (I’ve searched
this forum and everyone seems to use Ubound).
Is there a better way to do this? This must be a common need and a common
problem, but I haven’t been able to find the answer.
Thanks!
Don
some forms open. The forms call a procedure in a module tests to see if the
arrays have values; if not, it Redims them and sets their values. The values
are used often throughout my application.
I use Ubound(array, 1) to test if the array has values. If the array has not
been Redimmed and it’s values haven’t been set, Ubound gives a “subscript out
of range†error. I test for the error with On Error Goto mylabel; at mylabel:
there is code for filling the arrays.
Often (but not always), the On Error fails to trap the error and throws the
error back to the procedure that called it, skipping the label and thus not
filling an array.
The problem seems to be how to test for values in an array (I’ve searched
this forum and everyone seems to use Ubound).
Is there a better way to do this? This must be a common need and a common
problem, but I haven’t been able to find the answer.
Thanks!
Don