单选题
VB
题号 #453433
如下程序段定义了一个记录有关计算机系统的信息的用户定义类型:
Type SystemInfo
VideoColors As Integer
Cost As Currency
DiskDrives(1 to 2)As String
EndType
若对某个计算机系统信息的各数据项进行赋值,下列程序段正确的是( )。
A.
Dim S As Systemlnfo
Systemlnf0.VideoColors=201
Systemlnf0.Cost=234.5
Systemlnf0.DiskDrives=“1.44 MB”__”100M SCSI”
B.
Dim S As Systemlnfo
S.VideoColors=201
S.Cost=234.5
S.DiskDrives(1)=“1.44 MB”
S.DiskDrives(2)=”100M SCSI”
C.
Dim S As Systemlnfo
S.VideoColors=201
S.Currency=234.5
S.DiskDrives=“1.44 MB”__,“100M SCSI”
D.
Dim S As Systemlnfo
Systemlnfo.VideoColors=201
Systemlnfo.Cost=234.5
Systemlnfo.DiskDrives(0)=”__1.44 MB”
Systemlnfo.DiskDrives(1)=“____100M SCSI”
参考答案
B
答案解析
定义了记录类型后,可以用“变量.元素名”的格式引用记录中的各个成员。即给变量中的每个成员单个赋值。注意如果是数组类型的成员,则按照普通数组元素赋值的方法。给每一个数组元素单个赋值。