可以用类来实现吧?看看下面的方法是否契合你的目的?
类的代码:
Option Explicit
Public code As String
Public count As Integer
Public fcode As Class1
Public ccode As Class1
窗体调用代码
Private Sub Form_Load()
Dim a As New Class1
Dim b As New Class1
b.count = 123
Set a.ccode = b
MsgBox a.ccode.count
End Sub
试试以下定义,应该可以满足你的要求:
Type 编码属性1
编码 As String
子数量 As Integer
End Type
Type 编码属性2
父编码 As 编码属性1
子编码() As 编码属性1
End Type
Dim a() as 编码属性2
你没有实例化对象,
For j = 0 To i
pt(j)=new point() '加上这句,实例化pt(j)
pt(j).x = j 'Debug时此处出错
pt(j).y = j ^ 2
Next
建议把编码放到数据库中