Long String Error

S

Scott

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
 
B

Bob Barrows

Scott said:
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?
 
A

Anthony Jones

Scott said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top