Long String Error

Discussion in 'ASP General' started by Scott, Nov 11, 2008.

  1. Scott

    Scott Guest

    I'm trying to capture all form elements posted on a page and concatenate
    them into a string for testing and to include in an email message. I'm
    getting the below error "Out of string space". I thought using the "chr(13)
    & chr(10)" characters at the end of each line would fix the issue, but it
    doesn't work.

    How can I get such a long string concatenated without the below error?

    ' Code: ***********************************

    <%
    sRequestForm = "<TABLE><TR><TD><B>Request Form Values</B></TD>" & chr(13)
    & chr(10)
    sRequestForm = sRequestForm & sRequestForm & "<TD><B>Value</B></TD></TR>"
    & chr(13) & chr(10)

    For Each s in Request.Form

    sRequestForm = sRequestForm & sRequestForm & "<TR><TD>" & name & "</TD>"
    & chr(13) & chr(10)
    sRequestForm = sRequestForm & sRequestForm & "<TD>" & Request.Form(s) &
    "</TD>" & chr(13) & chr(10)
    sRequestForm = sRequestForm & sRequestForm & "</TR>" & chr(13) & chr(10)

    Next

    sRequestForm = sRequestForm & sRequestForm & "</TABLE>"

    Response.Write "sRequestForm: " & sRequestForm & "<BR>"
    %>


    ' Error: **********************************
    Microsoft VBScript runtime error '800a000e'

    Out of string space

    /bathroom_wall_sign.asp, line 668
     
    Scott, Nov 11, 2008
    #1
    1. Advertising

  2. Scott

    Bob Barrows Guest

    Scott wrote:
    > I'm trying to capture all form elements posted on a page and
    > concatenate them into a string for testing and to include in an email
    > message. I'm getting the below error "Out of string space". I thought
    > using the "chr(13) & chr(10)" characters at the end of each line
    > would fix the issue, but it doesn't work.
    >
    > How can I get such a long string concatenated without the below error?
    >


    Create smaller strings in multiple variables?

    --
    HTH,
    Bob Barrows
     
    Bob Barrows, Nov 11, 2008
    #2
    1. Advertising

  3. "Scott" <> wrote in message
    news:...
    > I'm trying to capture all form elements posted on a page and concatenate
    > them into a string for testing and to include in an email message. I'm
    > getting the below error "Out of string space". I thought using the
    > "chr(13) & chr(10)" characters at the end of each line would fix the
    > issue, but it doesn't work.
    >
    > How can I get such a long string concatenated without the below error?
    >
    > ' Code: ***********************************
    >
    > <%
    > sRequestForm = "<TABLE><TR><TD><B>Request Form Values</B></TD>" & chr(13)
    > & chr(10)
    > sRequestForm = sRequestForm & sRequestForm & "<TD><B>Value</B></TD></TR>"
    > & chr(13) & chr(10)
    >
    > For Each s in Request.Form
    >
    > sRequestForm = sRequestForm & sRequestForm & "<TR><TD>" & name & "</TD>"
    > & chr(13) & chr(10)
    > sRequestForm = sRequestForm & sRequestForm & "<TD>" & Request.Form(s) &
    > "</TD>" & chr(13) & chr(10)
    > sRequestForm = sRequestForm & sRequestForm & "</TR>" & chr(13) & chr(10)
    >
    > Next
    >
    > sRequestForm = sRequestForm & sRequestForm & "</TABLE>"
    >
    > Response.Write "sRequestForm: " & sRequestForm & "<BR>"
    > %>
    >
    >
    > ' Error: **********************************
    > Microsoft VBScript runtime error '800a000e'
    >
    > Out of string space
    >



    Your main problem is doubling up the sRequestFrom like this:-

    sRequestForm = sRequestForm & sRequestForm & "<TD>" & Request.Form(s)

    Put this in a loop an sRequest form is growing exponentially, I suspect you
    meant this to be:-

    sRequestForm = sRequestForm & "<TD>" & Request.Form(s)

    Similalry with all other occurances of sRequestForm & sRequestForm you
    actually only want one sRequestForm.

    BTW, drop call the chr(13) chr(10) marlarky the HTML will render find
    without them.

    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Nov 11, 2008
    #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. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    691
    Eric Sosman
    Jul 8, 2003
  2. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,205
    Peter Shaggy Haywood
    Sep 20, 2005
  3. Mathieu Dutour

    long long and long

    Mathieu Dutour, Jul 17, 2007, in forum: C Programming
    Replies:
    4
    Views:
    486
    santosh
    Jul 24, 2007
  4. Bart C

    Use of Long and Long Long

    Bart C, Jan 9, 2008, in forum: C Programming
    Replies:
    27
    Views:
    816
    Peter Nilsson
    Jan 15, 2008
  5. veryhotsausage
    Replies:
    1
    Views:
    1,816
    veryhotsausage
    Jul 4, 2008
Loading...

Share This Page