|
-
Feb 24th, 2000, 12:39 AM
#1
Thread Starter
Addicted Member
Perhaps a simple question, bu can anyone tell me the simplist way to count the depth of my array ... like the count method in the collection class.
Do I have to loop through until an error is raised to determine how many of an array I have?
-
Feb 24th, 2000, 12:51 AM
#2
If you have an array of a primitive data type (like Integer or Single) then use the UBound and LBound functions:
Code:
MsgBox "Number of items in the array: " & UBound(MyArray) - LBound(MyArray) + 1
If it's a control array use the Count method or the UBound and LBound methods.
Good luck!
Edited by Joacim Andersson on 02-24-2000 at 12:52 PM
-
Feb 24th, 2000, 01:02 AM
#3
Thread Starter
Addicted Member
Thank you, but it's actually an array of strings.
To be specific, it's an array created using Split() to separate folders froma path. ("C:\Windows\System\" becomes "C:", "Windows", and "System".
-
Feb 24th, 2000, 01:24 AM
#4
Thread Starter
Addicted Member
Nevermind ... UBound works.
-
Feb 24th, 2000, 03:55 AM
#5
Primitive Data Types are:
Byte
Integer
Long
Single
Double
Currency
String
Variant
Date
Boolean
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
|