首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

VB6结构使用解决办法

2012-04-26 
VB6结构使用Public Type AAA() As StringEnd TypePublic Type BBB() As StringEnd Type-----------------

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?

[解决办法]
是这意思麽?

VB code
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
[解决办法]
使用类模块代替结构体。

热点排行