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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking if Dynamic Array is initialized

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
GB
Can u not use the isArray(Myarray) for a dynamic array?

If i check what UBound of MyArray is it returns 'Subscript out of range'

If i then do IsArray(Myarray) it returns true *shrug*

Cheers for any help!
 
Following code is extracted from MSPRESS Hardcore Visual Basic, Second Edition ISBN 1-57231-422-2 p.279

Function IsArrayEmpty(va As Variant) As Boolean
Dim f As Boolean
On Error Resume Next
f = IsObject(va(LBound(va)))
IsArrayEmpty = (Err <> 0)
End Function


It is published on the web by MS at: (corrections to this edition)
_________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top