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

How many strings are in an array

Status
Not open for further replies.

winline

Programmer
Joined
Dec 30, 2002
Messages
13
Location
AU
Hi Fello Tek-Tipions!

I want to read a file into an array. OK - that is done OK.
I use this as my code:
Open For Input As #1
Dim stringVar$
stringVar = Input(Lof(1), 1)
Dim a
a = Split(stringVar, vbCrLf)

but how can i then see how many lines of text there are in the arrary?

Thanx in advance
 
Ubound(a)
Tuna - It's fat free until you add the Mayo!
 
Split function returns a zero-based array and Ubound returns the highest index, so there will be Ubound(a) + 1 strings
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Where can I find the split function? is it a VB 6 native function?
 
Yes - in VB6
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Thank you al for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top