ASP-Based Webmail: Include Original Reply Formatting

Discussion in 'ASP General' started by JStrummer, Aug 27, 2004.

  1. JStrummer

    JStrummer Guest

    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.
    JStrummer, Aug 27, 2004
    #1
    1. Advertising

  2. JStrummer

    Coz Guest

    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" <4ward.com> wrote in message
    news:...
    > 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.
    Coz, Aug 27, 2004
    #2
    1. Advertising

  3. JStrummer

    Evertjan. Guest

    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)
    Evertjan., Aug 27, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Bogenberger
    Replies:
    3
    Views:
    858
    Andreas Bogenberger
    Feb 22, 2008
  2. davidj411
    Replies:
    1
    Views:
    1,007
    Mike Driscoll
    May 27, 2008
  3. Replies:
    2
    Views:
    527
  4. Malcolm Greene
    Replies:
    1
    Views:
    419
    Martin v. Loewis
    Apr 16, 2010
  5. David Aldred

    AsP webmail

    David Aldred, Feb 7, 2004, in forum: ASP General
    Replies:
    6
    Views:
    138
    David Aldred
    Feb 15, 2004
Loading...

Share This Page