PDA

View Full Version : comma delimited txt to different textboxes


____________
12-03-2006, 04:04 AM
Hi, i have this in a txt:

data1, data2, data3, data4

And i need to split that line in 4 values, i need 4 different textboxes containing those values like

data1.text
data2.text
data3.text
data4.text

Im using VISUAL BASIC 6.0, any idea? thnkx for advance

sage45
12-03-2006, 07:54 AM
You could setup an array and split text based upon the comma... From then it's just the simple matter of assigning the text from the array to the associated text box... For example:Sub Splitter()
Dim tempArray as String, tstText as String, idx as Integer
tstText = "test1, test2, test3, test4"
tempArray = Split(tstText, ",")
For each idx in tempArray
data[idx].text = tempArray[idx]
Next
End SubHTH,

-sage-