日期:2011-12-21  浏览次数:21036 次

<%
'****************************************
'类名:双联动菜单类
'****************************************
'本类由 [71port]sean, [71port]80端口 原创编写
'[爱易学习网] 修改完善BUG,版权没有,任意抄写,注意完整
'公开发布于2005年12月10日
'欢迎访问http://www.71port.com,爱易学习网WEB开发


Class DCombo
'****************示例*********************
'Response.write "<form name=frm>"

'Dim DC
'Set DC =New DCombo
'DC.GroupData="GD,广东省|GZ,广州市$GD,广东省|DG,东莞市$GX,广西|NN,南宁市$GD,广东省|SS,深圳$"  
'变量数据格式="第一列表值,名称|第二列表值,名称$第一列表值,名称|第二列表值,名称$"
'DC.DCform="frm"  'form的名称要唯一
'DC.DC1Name="第一列表"  '第一列表的名称
'DC.DC2Name="第一列表"  '第二列表的名称
'DC.Combo1Name="ComboName1" '第一列表的NAME
'DC.Combo2Name="ComboName2" '第二列表的NAME
'response.Write DC.ReturnDo
'Set DC=nothing

'Response.write "</form>"
'****************示例*********************

Private myGroupData,myDCform,myCombo1Name,myCombo2Name,myFirstType,mySecType
Private mylvzf,str,f1,f2,cs
Private myDC1Name,myDC2Name,myList1value,myList2value
Private HaveErr,Do_Tmp
Private Sub Class_Initialize()
HaveErr=False
myGroupData=""
myDCform=""
myDC1Name=""
myDC2Name=""
myList1value=""
myList2value=""
myCombo1Name=""
myCombo2Name=""
Do_Tmp=""
End Sub
Public Sub Clear()
HaveErr=False
End Sub
Private Sub Class_Terminate()
Clear()
myGroupData=""
myDCform=""
myDC1Name=""
myDC2Name=""
myList1value=""
myList2value=""
myCombo1Name=""
myCombo2Name=""
Do_Tmp=""
End Sub
Public Property Let GroupData(value)
myGroupData=value
myGroupData=lvzf(myGroupData)
End Property
Public Property Let DCform(value)
myDCform=value
myDCform=lvzf(myDCform)
End Property
Public Property Let Combo1Name(value)
myCombo1Name=value
End Property
Public Property Let Combo2Name(value)
myCombo2Name=value
End Property
Public Property Let DC1Name(value)
myDC1Name=value
End Property
Public Property Let DC2Name(value)
myDC2Name=value
End Property
Public Property Let List1value(value)
myList1value=value
End Property
Public Property Let List2value(value)
myList2value=value
End Property
Public Function lvzf(mylvzf)
mylvzf=replace(mylvzf," ","")
mylvzf=replace(mylvzf,"(","")
mylvzf=replace(mylvzf,")","")
mylvzf=replace(mylvzf,"'","")
mylvzf=replace(mylvzf,"“","")
mylvzf=replace(mylvzf,"”","")
lvzf=mylvzf
End  Function
Public Function GetArray(str,f1,f2)
Dim i,x,y,tmp_a,tmp_b,a,b
tmp_a=split(str,f1)
x=ubound(tmp_a)-1
For i=0 To x
tmp_b=split(tmp_a(i),f2)
If ubound(tmp_b)>=y Then y=ubound(tmp_b)
Next
ReDim Result(x,y)
For a=0 To x
ReDim tmp_b(y)
tmp_b=split(tmp_a(a),f2)
If ubound(tmp_b)<>y Then HaveErr=True : Exit Function
For b=0 To y
Result(a,b)=tmp_b(b)
Next
Next
GetArray=Result
End Function
Public Function  GetGroup(ArrayTmp)
Dim i,ii,iii,j,k,NoCF,FirstType_Temp
ReDim PubTmp(Ubound(ArrayTmp,1))
For i=0 To Ubound(ArrayTmp,1)
NoCF=True
If i=0 Then PubTmp(i)=ArrayTmp(0,0):FirstType_Temp=ArrayTmp(0,0)
For j=0 To i
If PubTmp(j)=ArrayTmp(i,0) Then NoCF=False
Next
If NoCF=True Then FirstType_Temp=FirstType_Temp&"|"&ArrayTmp(i,0) : PubTmp(i)=ArrayTmp(i,0)
Next
myFirstType=Split(FirstType_Temp,"|")
ReDim Result(Ubound(myFirstType),Ubound(ArrayTmp,1)+1)
For ii=0 To Ubound(myFirstType)
Result(ii,0)=myFirstType(ii)
k=0
j=0
NoCF=True
       For