Results 1 to 8 of 8

Thread: CrLf processed in Response.Write and MEMO fields

  1. #1

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134

    CrLf processed in Response.Write and MEMO fields

    I've got a Q.

    I have a MEMO field in an ACCESS database. I have a textarea that's contents are written to the field. That part is okay.

    But then, when I am showing this memo field (response.write), will line returns in the textarea be written as nothing or line returns?

    And if the above's answer is yes, when response.written, will they display correctly?

    (I am writing a forum)
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  2. #2
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386
    CrLf's will be processed as CrLf... so if you want to show them as a CrLf on a html page, you need to replace them with the <br> tag.
    Hope this helps

    Crazy D

  3. #3

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Sounds good... then I guess my next Q would be, how would I kill all of the CrLfs in a string and turn them into <BR>s?

    Is InStr present in VBScript?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    You can use the VBScript Replace function
    Example:
    Code:
    Response.Write Replace(rs("MyMemoField"), vbCrLf, "<br>")
    An alternative to this is to use the <PRE> tags, these preserve formatting (like line breaks) so you don't have to modify the text at all

    Example:
    Code:
    <pre>
    
    Hello
    
    World
    
    </pre>
    this will preserve the line breaks


    Tom

  5. #5

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Sweet! Erm... I mean, I'm more civilized than that!...
    I guess...
    Thanks for helping me out!
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  6. #6

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    And if it's okay w/VB-World i'm gunna use their smileys
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  7. #7

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Okay, I've got another question for you guys.

    I want to parse all web addresses in to anchor tags. If possible I would also like to find out the title of that page, so I can put it into the <A></A> tags. I know the second part probably can't be done, but what about the first part?

    EG. VB-World parses HTTP strings:

    http://www.vb-world.net/
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  8. #8
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Use the RegExp object of VB Script 5.5. I have created a regular expression that does the parsing and turns it into a URL. If you need the code let me know


    Tom

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