|
-
Jul 28th, 2000, 05:15 PM
#1
Thread Starter
Addicted Member
Im using Split to parse a string with a statment like:
Code:
Dim X As Variant
X = Split(InputData$, "|")
Does anyone know how to see how many fields that Split created because if I try to MsgBox X(99) but the string only contained 98 fields, I get an error, how can I see how many fields it created in X?
-
Jul 28th, 2000, 05:29 PM
#2
Use UBound() to get the highest index.
Code:
Retval = Split("One|Two|Three|Four", "|")
For I = 0 To UBound(Retval)
Print Retval(I)
Next I
-
Jul 28th, 2000, 06:46 PM
#3
Fanatic Member
Code:
'PURPOSE:Break up string basing on " " and stick into an array
Dim str_Split() As String
str_Split = Split("How | Are | You", "|")
MsgBox "There are " & UBound(str_Split) & " occurence."
Dim int_X As Integer
Dim str_Data As String
For int_X = LBound(str_Split) To UBound(str_Split)
str_Data = str_Data & vbCrLf & str_Split(int_X)
Next
MsgBox str_Data
Chemically Formulated As:
Dr. Nitro
-
Jul 29th, 2000, 12:01 AM
#4
transcendental analytic
Code:
Count = ubound(split("A|B|C","|")) + 1
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|