Reputation: 2431
Here's my code so far:
Dim i As Integer
Dim stringArray() as String
stringArray = split("Hello|there", "|")
For i = 0 To stringArray.Length()
' Logic goes here
Next
VB6 doesn't seem to like me using stringAray.Length()
and gives me a compile error message like Invalid Qualifier
, but what's the right way to iterate through each element of a string array?
Upvotes: 11
Views: 47949
Reputation: 19
Dim i As Integer
Dim stringArray() as String
stringArray = split("Hello|there", "|")
For i = 0 To ubound(stringArray)
' Logic goes here
Next
Upvotes: 0
Reputation: 175796
ubound()
returns the upper bounds;
Dim i As Long
Dim stringArray(1) as String
stringArray(0) = "hello"
stringArray(1) = "world"
For i = 0 To ubound(stringArray)
msgbox(stringArray(i))
Next
Upvotes: 19