<%
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'快速字符串連接類
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'名稱:Class_FastString
'來源:http://www.jansfreeware.com
'整理:qihangnet
'更新:2005年6月15日
'作用:高效地進行字符串連接,比 str = str & "abc"的方法快很多
'授權:免費使用
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Class Class_FastString
'************************************
'變量定義
'************************************
'index --- 字符串數組的下標
'ub ------ 用於調整數組度數的整數變量
'ar() ---- 字符串數組
Private index, ub, ar()
'************************************
'實例 初始化/終止
'************************************
Private Sub Class_Initialize()
Redim ar(50)
index = 0
ub = 49
End Sub
Private Sub Class_Terminate()
Erase ar
End Sub
'************************************
'事件
'************************************
'默認事件,添加字符串
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
'************************************
'方法
'************************************
'返回連接後的字符串
Public Function Dump
Redim preserve ar(index-1)
Dump = join(ar,"") '關鍵所在哦^_^
End Function
End class
%>