VB6结构使用
Public Type A
AA() As String
End Type
Public Type B
BB() As String
End Type
'-------------------
Public Type DEF
DD() As Variant
End Type
Public Type ABC
EE() As DEF
End Type
Public Test As ABC
VB6怎么在代码中依需求指定DD()下层阵列结构型态为A或B?
[解决办法]
是这意思麽?
Public Type A AA() As StringEnd TypePublic Type B BB() As StringEnd Type'-------------------Public Type DType AA() As A BB() As BEnd TypePublic Type DEF DD() As DTypeEnd TypePublic Type ABC EE() As DEFEnd TypePublic Test As ABCPublic Test2 As DTypeSub Main() ReDim Test2.AA(10) ReDim Test2.BB(5)End Sub
[解决办法]
使用类模块代替结构体。