|
-
Mar 20th, 2002, 03:37 PM
#1
Thread Starter
PowerPoster
How do I know if an array is empty or not?
Have you noticed that if you do the len() function on a filled array or if you do an ubound() function on an empty array you get errors?
How do I work around this?
thanks
-
Mar 20th, 2002, 03:39 PM
#2
Thread Starter
PowerPoster
I think isarray() will do it
-
Mar 20th, 2002, 04:56 PM
#3
PowerPoster
The reason is that you're not using those functions on an empty array - you're doing it on an array you've only declared, but never used, or given size or data to.
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Mar 20th, 2002, 05:32 PM
#4
PowerPoster
Try this
VB Code:
Dim MyArray(10) As String
Dim Whole As String
Whole = Join(MyArray)
If Whole = Space(UBound(MyArray)) Then MsgBox "Array is Empty"
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Mar 21st, 2002, 07:36 AM
#5
Thread Starter
PowerPoster
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|