Results 1 to 3 of 3

Thread: hwo can I use a SPLIT command ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208

    Angry

    how can I use a split command for that:


    ampersand = InStr(1, InetAWS, "¦")
    If ampersand <> 0 Then
    LINES = Mid(InetAWS, 1, ampersand - 1) & vbCrLf & InetAWS & Mid(InetAWS, ampersand + 1, Len(InetAWS) - ampersand + 1)
    End If

    ( Each ¦ in the variable inetAWS will be replace by <ENTER>)

    but this ismy problem:

    exemple:
    before
    1¦2¦3¦4
    after
    1
    2¦3¦4

    only the first symbol is replaced ..

    How can I fix this bug ??



  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461
    Code:
    Dim i as Integer
    Dim Result as Variant ' MUST be a variant
    
    Result = Split(Source,"|")
    
    For i = 0 to UBound(Result)
      MsgBox Result(i)
    Next i

  3. #3
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461
    I just read your question again and you don't want the Split command at all!!!

    You want to use the replace command

    Code:
    LINE = Replace(InetAWS,"|",vbCRLF)
    That replaces all instances of the pipe character with a Carriage Return and Line Feed.

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