|
-
Apr 8th, 2003, 05:13 PM
#1
Thread Starter
Junior Member
ackward loop Q [resolved]
*edit* wow u guys are good..thanks
i'm sending information over network w/ winsock and i want to take this information and put it in a listbox
an example of how it comes in w/ Getdata
Nick....]Joe....]Mike....]]
whats between the name and the "]" is not important, i just used them to seperate the data
and the double "]" at the end signifies the end of the data i need
i want the listbox to have
Nick....
Joe.....
Mike....
i need help with a loop that will find the "]" and take the data up to that point, and then search after that point in the next run of the loop
Do you understand? here's what i tried but it didn't work right
Code:
Do
sTemp1 = Mid(sData, 10)
sTemp2 = Mid(sTemp1, 1, InStr(1, sTemp1, "]") + 1)
strX = Right(sTemp2, 2)
sTemp3 = Left(sTemp2, Len(sTemp2) - 2)
List1.AddItem sTemp3
Loop Until strX = "]]"
Last edited by VBnewbie2002; Apr 8th, 2003 at 05:43 PM.
-
Apr 8th, 2003, 05:21 PM
#2
Addicted Member
here:
VB Code:
Dim a() As String, k As Integer
Const file = "Nick....]Joe....]Mike....]]"
a() = Split(file, "]")
For k = LBound(a) To UBound(a)
If a(k) <> "" Then
List1.AddItem a(k)
End If
Next k
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
|