I'm used to using a basic script which allows me to use a function called ArrayDims() to determine the dimensions of an array. This is very helpful for routines that operate on dynamic arrays, because if i know that the array has been dimensioned i can begin stepping through it to do whatever needs to be done. If it hasn't been dimensioned, then i can skip that step. Is there any way in standard VB to check this? I keep having my code crash because the UBound returns an error if the array has not been dimensioned.

Specifically, this is what i'm talking about. I load values into an array from a database, redimensioning the array as needed. If the table i'm reading from has no records, however, the array stays undimensioned. Next i perform some sort of operation on the items i just read in by stepping through the array (for i = 0 to UBound). In the VB script i've been using, i would simply check arraydims first, and if the array had values i would perform the operation. In VB i can't use that command though, so the code crashes!

Any help would be appreciated.