关于记录类型的问题,请高人指点下:

来源:百度知道 编辑:UC知道 时间:2024/06/15 00:49:45
type stdull
no as integer
name as string*10
score(1 to 3) as single
end type
书上说数据类型元素名不能是数组名,可是该程序是一道习题上说是正确的答案,score(1 to 3)不是数组吗?请问为什么啊

这样写是没有问题的。书是怎么回事我也不知道。
MSDN解释应该比较权威吧。
===================
下面的示例演示了一个用户自定义类型的大小固定的数组的用法:

Type StateData
CityCode (1 To 100) As Integer ' Declare a static array.
County As String * 30
End Type

Dim Washington(1 To 100) As StateData

在上述示例中,StateData 中包括了一个 CityCode 静态数组,且记录Washington 的结构与 StateData 相同。