列2-1声明数据类型对象Student
'Dim MyS(30) As Student声明数据类型数组——PS:此行为注释
'声明数据类型——PS:此行为注释
Type Student
Name As String
Sex As Boolean
Age As Integer
End Type
'函数——PS:此行为注释
Sub Demo2()
'实例化类——PS:此行为注释
Dim MyS As Student
MyS.Name = "张三"
MyS.Sex = False
MyS.Age = 20
MsgBox MyS.Name
End Sub
'声明数据类型这一段一定要放在函数前面,不然会提示
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~