7,759
社区成员
发帖
与我相关
我的任务
分享
Private Type test
inttst As Integer '整形成员
arytst() As Integer '动态数组成员
End Type
Private Sub Command1_Click()
Dim i As Integer
Dim a As test
ReDim a.arytst(5) '定义数组成员
a.inttst = 100 '整数成员赋值
For i = 0 To 5 '数组成员赋值
a.arytst(i) = i * 2
Next
Debug.Print a.arytst(5) '检验结果
ReDim a.arytst(10) '再次重定义数组成员
For i = 0 To 10 '数组成员赋值
a.arytst(i) = i * 3
Next
Debug.Print a.arytst(10) '检验结果
End Sub