Connecting Tech Pros Worldwide Help | Site Map

Long String Error

  #1  
Old November 11th, 2008, 05:55 PM
Scott
Guest
 
Posts: n/a
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

  #2  
Old November 11th, 2008, 06:25 PM
Jon Paal [MSMD]
Guest
 
Posts: n/a

re: Long String Error


http://msdn.microsoft.com/en-us/libr...44(VS.85).aspx




"Scott" <sbailey@mileslumber.comwrote in message news:ezavRXCRJHA.5092@TK2MSFTNGP05.phx.gbl...
Quote:
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

  #3  
Old November 11th, 2008, 07:05 PM
Bob Barrows
Guest
 
Posts: n/a

re: Long String Error


Scott wrote:
Quote:
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


  #4  
Old November 11th, 2008, 11:05 PM
Anthony Jones
Guest
 
Posts: n/a

re: Long String Error


"Scott" <sbailey@mileslumber.comwrote in message
news:ezavRXCRJHA.5092@TK2MSFTNGP05.phx.gbl...
Quote:
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

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fsockopen expects parameter 2 to be long. String given. ryanhami answers 4 November 8th, 2008 06:37 PM
help with Perl code to insert a long string (> 32512 chars) via stored procedure andrewkl answers 3 January 8th, 2008 06:59 AM
Convert a long string to integer dan w01 answers 7 December 6th, 2007 08:15 AM
string error Tiago Costa answers 8 November 16th, 2005 09:15 AM