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

Check for zero-length array? 1

Status
Not open for further replies.

Ed2020

Programmer
Nov 12, 2001
1,899
GB
Hi,

Is it possible, in VB6, to check for a zero length array (i.e., one with no elements)?

TIA,

Ed Metcalfe.

Please do not feed the trolls.....
 

I think that UBound or Lbound shall raise an error number 9 with description of Subscript out of range...
 
Jerry,

Thanks for your reply.

Is there anyway of checking without relying on trapping an exception?

Ed Metcalfe.

Please do not feed the trolls.....
 
Thanks Tyson. Have a star.

Ed Metcalfe.

Please do not feed the trolls.....
 
And a keyword search of this forum would have found a home-grown variant in thread222-836312 which was a later derivative of the earlier thread222-443102
 
Greg,

Arrays are not considered objects in VB6 (unlike newer languages such as Java and the .Net languages) so =Nothing doesn't work.

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top