Results 1 to 3 of 3

Thread: please help me with parsing this right!!

  1. #1

    Thread Starter
    Lively Member Scorpionz's Avatar
    Join Date
    Feb 1999
    Location
    lafayette/kaplan, louisiana, usa
    Posts
    72

    Exclamation

    no one has given me a positive answer on how to parse this:

    373 3 3 113 "hello there" "sup all" 4 4

    into a listbox like this:

    373
    3
    3
    113
    hello there
    sup all
    4
    4

    please help!!

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Well here you go, the idea is to parse out the stuff between the " "s and add it in the listbox while splitting up the rest.
    Code:
        Dim x&, x2&, n, text$
            
            text = "373 3 3 113 ""hello there"" ""sup all"" 4 4 "
        Do
            x = InStr(x2 + 1, text, """")
            If x = 0 Then x = Len(text) + 1
                For Each n In Split(Mid(text, x2 + 1, x - x2 - 1), " ")
                    If Len(n) Then List1.AddItem n
                Next n
            x2 = InStr(x + 1, text, """")
            If x2 Then List1.AddItem Mid(text, x + 1, x2 - x - 1)
        Loop While x2
    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.

  3. #3

    Thread Starter
    Lively Member Scorpionz's Avatar
    Join Date
    Feb 1999
    Location
    lafayette/kaplan, louisiana, usa
    Posts
    72
    FINALLY!!!!!!!!

    thank you thank you thank you thank you!!!

    your the man keda

    ooxoxoxoxox

    =P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width