<%
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'Fast string concatenation class
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'Name: Class_FastString
'Source: http://www.jansfreeware.com
'Organization: qihangnet
'Update: June 15, 2005
'Function: Concatenate strings efficiently, much faster than str = str & "abc" method
'Authorization: Free to use
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Class Class_FastString
'************ ***************************
'Variable definition
'************************************
'index --- the index of the string array
'ub ------ Integer variable used to adjust the degree of the array
'ar() ---- String array
Private index, ub, ar()
'****************************** ****
'Instance initialization/termination
'************************************
Private Sub Class_Initialize()
Redim ar(50)
index = 0
ub = 49
End Sub
Private Sub Class_Terminate()
Erase ar
End Sub
'************************************
'event
'************************************
'Default event, add string
Public Default Sub Add(value)
ar(index) = value
index = index+1
If index>ub Then
ub = ub + 50
Redim Preserve ar(ub)
End if
End Sub
'************************************
'method
'************************************
'Returns the concatenated string
Public Function Dump
Redim preserve ar(index-1)
Dump = join(ar,"") 'The key is ^_^
End Function
End class
%>