Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 02:54 PM
JStrummer
Guest
 
Posts: n/a
Default ASP-Based Webmail: Include Original Reply Formatting

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.
  #2  
Old July 19th, 2005, 02:54 PM
Coz
Guest
 
Posts: n/a
Default Re: ASP-Based Webmail: Include Original Reply Formatting

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.c om...[color=blue]
> 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.[/color]


  #3  
Old July 19th, 2005, 02:55 PM
Evertjan.
Guest
 
Posts: n/a
Default Re: ASP-Based Webmail: Include Original Reply Formatting

Coz wrote on 27 aug 2004 in microsoft.public.inetserver.asp.general:
[color=blue]
> 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[/color]

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)

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles