Results 1 to 10 of 10

Thread: How canI replace ALL the ¦ caracters by a VbCtLf ????

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208

    Angry

    I recieve a message ( inetAWS ) and it contain a lot of ¦ caracter..
    I must replace all the ¦ caracter by a <ENTER>

    exemple:

    inetAWS= "1¦2¦3¦4¦5"

    after , in textbox 1:
    1
    2
    3
    4
    5


    How can I do this ??

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Make that:

    Text1.Text = Replace(Text1, "¦", VbCRLf)
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3
    Guest
    Excuse me! The difference ppl?
    VB constant names are not case sensitive!!!!

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Eh, the difference is that, when you type VbCRLf, the R automatically get's lowercase, and that looks funny, hehe, therefore it's better to do Jops way

    Actually i would just type vbcrlf, and watch it get capital so that i'm sure i didn't type it wrong, on the other hand you'll notice it is if you have option explicit
    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.

  5. #5
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Damn those joints again, I thought it was an T

    Damn hehe sorry for the problems, I should not smoke that lot...

    Hey, I know see that Matthew has Edited his post, so maybe I'm not that crazy after all

    [Edited by Jop on 08-31-2000 at 09:29 AM]
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  6. #6
    Guest
    If you don't have VB6, here is the VB5 equv.
    Code:
    Function Replace(sIn As String, sFind As String, sReplace As String, Optional nStart As Long = 1, Optional nCount As Long = -1, Optional bCompare As VbCompareMethod = vbBinaryCompare) As String
        Dim nC As Long, nPos As Integer, sOut As String
        sOut = sIn
        nPos = InStr(nStart, sOut, sFind, bCompare)
        If nPos = 0 Then GoTo EndFn:
        Do
            nC = nC + 1
            sOut = Left(sOut, nPos - 1) & sReplace & _
               Mid(sOut, nPos + Len(sFind))
            If nCount <> -1 And nC >= nCount Then Exit Do
            nPos = InStr(nStart, sOut, sFind, bCompare)
        Loop While nPos > 0
    EndFn:
        Replace = sOut
    End Function

  7. #7
    Member
    Join Date
    May 2000
    Location
    Canada
    Posts
    52
    If you saw this in the textbox, "1¦2¦3¦4¦5" , maybe you just forgot to set the multiline property to true.


  8. #8
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    d. Paulson, he's getting a response from a remote server, and the server uses | to seperate the string, and he's parsing it do different lines, but I think he'll work it out now with all the split functions!
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  9. #9
    Guest
    Forgive me, I'm sorry. I'm new to VB 6.0, just learning, I think I'll go learn some more before answering a VB 6.0 question.

    Really sorry about that .

  10. #10
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I'm sure there was a faster function probably named myReplace, and i'm almost sure somone is going to post it

    I would if wasn't using this slow comp which usually crashes when you at least want it to.
    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.

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