tokenizing a string

fragnus
06-07-2003, 11:36 PM
Hi everyone,
I usually program in Java 2, and I just started writing code in VB6. I have this line read in from a text file:

3 idsouk 4

My question is how do I read this in one token at a time after I call Input? Basically I want to read it in so that I can work with "3" then "idsouk" and then "4", or in any similar manner in which I am not stuck with "3 idsouk 4" as a whole.



I know in Java2 we use StringTokenizer to accomplish this. Is there a special method in vb6 that I can read it in a token at a time?

thnx in advance,

fragnus

Robse
06-07-2003, 11:38 PM
Lookup the Split() function:


Private Sub Form_Load()
Dim a() As String
a = Split("3 idsouk 4")
Debug.Print a(0), a(1), a(2)
End Sub

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum