Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Large string creation to hold over 10,000 characters

Status
Not open for further replies.

123ASP

MIS
Nov 2, 2002
239
US
Hi,
How can I create a large string datatype that I use for concantenation of over 10,000 characters.
Is this correct:
dim Largstring as varchr(10000)

What I am really getting into is to create a large variable in which I assign a huge amount of data to it ensuring that It does not truncate any values.
Is this doable.
thanks
Al
 
Remeber that all variables are of dtatype Variant. You do not dim AS in vbScript. Therefore your data will not be truncated

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
I have had a string that was over 1.2 million chrachters in vbScript. The only problem that I encountered was that adding a few more characters to a string that long is very taxing (and slow). Here's a solution...

<%
Class strCat
Private IntCntr
Private strArray()
Private intLength
Public Property Get Length
Length = intLength
End Property
Public Property Let Length( ByVal intLen)
intLength = intLen
IntCntr = 0
Redim strArray(1)
strArray(0) = &quot;&quot;
Redim strArray(intLength)
End Property
Public Property Get Value
Value = Join( strArray,&quot;&quot;)
End Property
Private Sub Class_Initialize()
IntCntr = 0
Length = 100000
End Sub
Public function Add( strToAdd)
strArray(IntCntr) = strToAdd
IntCntr = IntCntr + 1
End function
End Class

set htmlOut = new StrCat

'this adds values to the string
htmlOut.add(&quot;your html here&quot;)

'this gets the value of the string
response.write htmlOut.value()


%>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
I had one once that was 250Mb...it was a very big CSV file :)

Something like over 8,000,000 lines long...not brave enough to do a character count...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top