|
Home > Archive > IIS ASP > August 2004 > ASP-Based Webmail: Include Original Reply Formatting
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
ASP-Based Webmail: Include Original Reply Formatting
|
|
| JStrummer 2004-08-27, 6:17 pm |
| I'm building an ASP-based CRM system; a user sees the original
message, posted from the database and can hit a Reply button to
generate a TEXTAREA field on the next page that houses the original
messages and allows them to type a reply and hit a "Send" button.
The original message from the database includes natural line breaks,
as submitted--it doesn't contain any HTML breaks.
I would like to accomplish two things:
1) Add a "> " before each line of the original message, as contained
in the reply
2) In conjunction with the "> " preceding each line, break the
original messge string into logical line lengths that fit inside the
textarea field and don't wrap
Any help would be appreciated.
| |
|
| might be a faster way, but you could loop and break the string up..in this
example, into 75 char lines:
x=0
str=""
Do while x<=len(str)
str=str & ">" & Mid (str, x, x+75) & vbCrLf
x=x+75
Loop
"JStrummer" <google-usenet@jstrummer.e4ward.com> wrote in message
news:137012e7.0408271027.25a55f2b@posting.google.com...
> I'm building an ASP-based CRM system; a user sees the original
> message, posted from the database and can hit a Reply button to
> generate a TEXTAREA field on the next page that houses the original
> messages and allows them to type a reply and hit a "Send" button.
>
> The original message from the database includes natural line breaks,
> as submitted--it doesn't contain any HTML breaks.
>
> I would like to accomplish two things:
>
> 1) Add a "> " before each line of the original message, as contained
> in the reply
>
> 2) In conjunction with the "> " preceding each line, break the
> original messge string into logical line lengths that fit inside the
> textarea field and don't wrap
>
> Any help would be appreciated.
| |
| Evertjan. 2004-08-27, 6:17 pm |
| Coz wrote on 27 aug 2004 in microsoft.public.inetserver.asp.general:
> might be a faster way, but you could loop and break the string up..in
> this example, into 75 char lines:
>
> x=0
> str=""
> Do while x<=len(str)
> str=str & ">" & Mid (str, x, x+75) & vbCrLf
> x=x+75
> Loop
Not very nice to break the words.
Using jscript, try this:
s += ' '
s = s.replace(/(.{1,70}) /g,"> $1\n")
or vbscript :
Set regEx = New RegExp
regEx.Pattern = "(.{1,70}) "
regEx.Global = True
s = regEx.Replace(s&" ","> $1" & vbCrLf)
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)
|
|
|
|
|