Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jagged array

Status
Not open for further replies.

and0b

MIS
Mar 27, 2007
51
US
Hi!
I have small problem with testing elements of array. Some of array elements are empty, some contains other arrays. Test
if aMyArray(3,101)= empty
works fine for empty elements but it is triggering runtime "Error #13: Type mismatch" for other elements. How can I determine which elements are empty which not?
I declared this array as variant.

Thanks for any help.
 

Have you tried:
Code:
If Len(aMyArray(3,101)) = 0 Then

Have fun.

---- Andy
 
it works for empty elements, for elements contain arrays it is still generating error message #13.
 

Check first if the element is an array using IsArray(). If not, then check if empty.

If it is an array, then check the elements of that accordingly.

 
Instead of:
[tt]If aMyArray(3, 101) = Empty Then[/tt]
use:
[tt]If IsEmpty(aMyArray(3, 101)) Then[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top