Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 Carridge return to <br>?
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

David K
Junior Member

494 Posts

Posted - 03 December 2002 :  12:46:39  Show Profile  Send David K an AOL message  Send David K an ICQ Message  Send David K a Yahoo! Message
i need to convert emails to HTML for localization reasons, so I want to add a proccessing function to inc_mail.asp
I want it to replace carridge returns and "vbNewLine" commands to a <br> html tags, I belive I can use rhe replace function, but what is the source character code?
thank you

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 03 December 2002 :  17:23:23  Show Profile
chr(10)

So

theComment = Replace(theComment,Chr(10),"<br>",1,-1,1)

should do it.

Edited by - Hamlin on 03 December 2002 17:25:10
Go to Top of Page

David K
Junior Member

494 Posts

Posted - 03 December 2002 :  19:24:59  Show Profile  Send David K an AOL message  Send David K an ICQ Message  Send David K a Yahoo! Message
thanks
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 03 December 2002 :  19:54:03  Show Profile  Visit Gremlin's Homepage
CR is actuall chr(13) - LF is chr(10)

http://www.asciitable.com/

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

David K
Junior Member

494 Posts

Posted - 04 December 2002 :  05:09:58  Show Profile  Send David K an AOL message  Send David K an ICQ Message  Send David K a Yahoo! Message
a vbNewLine command makes a CR, right?
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 04 December 2002 :  05:26:48  Show Profile  Visit Gremlin's Homepage
Pretty sure its like this.

vbNewLine = chr(13)
vbCRLF = chr(13) & chr(10)
vbLF = chr(10)

Kiwihosting.Net - The Forum Hosting Specialists

Edited by - Gremlin on 04 December 2002 05:28:54
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 04 December 2002 :  07:37:42  Show Profile


Constant Value Description
vbCr = Chr(13) Carriage return. VbCrLf = Chr(13) & Chr(10) Carriage return–linefeed combination. vbFormFeed = Chr(12) Form feed; not useful in Microsoft Windows. vbLf = Chr(10) Line feed. vbNewLine = Chr(13) & Chr(10) or Chr(10) Platform-specific newline character; whatever is appropriate for the platform. vbNullChar = Chr(0) Character having the value 0. vbNullString String having value 0 Not the same as a zero-length string (""); used for calling external procedures. vbTab = Chr(9) Horizontal tab. vbVerticalTab = Chr(11) Vertical tab; not useful in Microsoft Windows.
Go to Top of Page

David K
Junior Member

494 Posts

Posted - 05 December 2002 :  02:26:11  Show Profile  Send David K an AOL message  Send David K an ICQ Message  Send David K a Yahoo! Message
so how can I replace the vbNewLine calls for a "<br>" no matter what platform people are using?
Go to Top of Page

bjlt
Senior Member

1144 Posts

Posted - 05 December 2002 :  02:31:22  Show Profile
what's the difference between VbCrLf and vbNewLine?
is it ok to change all vbNewLine to VbCrLf? hence solve possible problems when doing such a convertion?
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 05 December 2002 :  02:46:28  Show Profile  Visit Gremlin's Homepage
quote:
Originally posted by David K

so how can I replace the vbNewLine calls for a "<br>" no matter what platform people are using?



Well try Replace(myString,vbNewLine,"<BR>")

Once the users entered the input, its then down to what the server interprets as being a vbNewLine I guess.

my Suggestion would be to play around, setup a form here and ask a few people perhaps to enter some data and see what you end up with.

Kiwihosting.Net - The Forum Hosting Specialists

Edited by - Gremlin on 05 December 2002 02:51:29
Go to Top of Page

bjlt
Senior Member

1144 Posts

Posted - 05 December 2002 :  03:39:04  Show Profile
fString = Replace(fString, CHR(13), "")
'fString = Replace(fString, CHR(10) & CHR(10), "<br /><br />")
fString = Replace(fString, CHR(10), "<br />")

this is what in function FormatStr
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 05 December 2002 :  06:35:00  Show Profile  Visit HuwR's Homepage
quote:
Originally posted by bjlt

what's the difference between VbCrLf and vbNewLine?
is it ok to change all vbNewLine to VbCrLf? hence solve possible problems when doing such a convertion?



VBNewLine is NOT platform specific, so depending on the servers OS it will write a different value.

YOU SHOULD ALWAYS USE VbNewLine, since sending a vbCrLf will not result in the correct eol markers on all platforms
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 05 December 2002 :  06:48:46  Show Profile  Visit Gremlin's Homepage
Actually we are talking about receiving not sending vbNewLines.

I'm not sure I understand your first sentance there Huw (could be just thats its the middle of the morning). It seems to contradict itself..... It's not platform specific, but depending on the server you'll get a different value ?

Kiwihosting.Net - The Forum Hosting Specialists

Edited by - Gremlin on 05 December 2002 06:50:51
Go to Top of Page

David K
Junior Member

494 Posts

Posted - 05 December 2002 :  08:06:34  Show Profile  Send David K an AOL message  Send David K an ICQ Message  Send David K a Yahoo! Message
Thank you everybody, I've succeded admirably!
here's the code I used to encode all emails to HTML (in inc_mail.asp):
dim HTMLMsg
dim strTmp
strTmp = strMessage
HTMLMsg = "<html DIR=""RTL"">" & vbNewLine & "<body>"
HTMLMsg = HTMLMsg & FormatStr(strTmp)
HTMLMsg = HTMLMsg & "</body></html>"

I needed it to support alignment of messages and links in Hebrew (ISO-8895-I) encoded emails
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 05 December 2002 :  08:23:08  Show Profile  Visit Gremlin's Homepage
Glad ya got something out of our collective ramblings then ;)

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 05 December 2002 :  09:36:44  Show Profile  Visit HuwR's Homepage
if you used vbCRLF to write a file to a unix server it would not understand the EOL markers correctly so it IS platform specific, vbNewLine on the other hand would write the correct value so it is NOT platform specific

ie
NOT platform specific means you can use it on ANY platform
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07