Array lengths

I'm writing code that produces an array. Its basically breaking down a file path. The problem that i'm having is that I am not bale to determine the length (size) of the array as it changes sizes

example C:\docs and settings\user\desktop\folder1\innerfolder\this_file.doc
C:\docs and settings\user\desktop\folder1\this2_file.doc

i'm using the split method to delimit the line breaking it into

substrings = Split(path, "\")

sub(0) = C: sub(0) = C:
sub(1) = docs and settings sub(1) = docs and settings
sub(2) = user sub(2) = user
sub(3) = desktop sub(3) = desktop
sub(4) = folder1 sub(4) = folder1
sub(5) = innerfolder sub(5) = this2_file.doc
sub(6) = this_file.doc

I am using a loop and utilizing the same undefined array on each loop

ANY HELP WOULD BE GREATLY APPRECIATED

[859 byte] By [cmwith] at [2007-12-22]
# 1

Set up your for loop like this:

Dim i as integer

for i = LBound(Substring()) to UBound(Substring())

<stuff>

next i

The Lbound and UBound functions return the upper and lower limits of the array dimension. For more information highlight UBound in your code and use the formidable "F1" key. This will provide some more information using UBound on multidimensional arrays.

rusty

rustycoder at 2007-8-30 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 2

THANK YOU SO MUCH FOR YOUR HELP, IT WAS GREATLY APPRECIATED!!!!!

THIS WORKED PERFECTLY!!!!!

cmwith at 2007-8-30 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...