Click to See Complete Forum and Search --> : CrLf processed in Response.Write and MEMO fields
Sastraxi
May 12th, 2001, 10:24 PM
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)
Crazy D
May 13th, 2001, 04:58 AM
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.
Sastraxi
May 13th, 2001, 10:53 AM
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?
Clunietp
May 13th, 2001, 12:40 PM
You can use the VBScript Replace function
Example:
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:
<pre>
Hello
World
</pre>
this will preserve the line breaks
Tom
Sastraxi
May 13th, 2001, 04:46 PM
Sweet! Erm... I mean, I'm more civilized than that!...
I guess...
Thanks for helping me out!
Sastraxi
May 13th, 2001, 06:55 PM
And if it's okay w/VB-World i'm gunna use their smileys:D
Sastraxi
May 13th, 2001, 07:35 PM
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/
Clunietp
May 14th, 2001, 11:36 PM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.