设在工程中定义了如下类型: Type stutype ino As Integer stmame As String*20 strsex As String*1 smark As Single

admin2010-03-30  24

问题 设在工程中定义了如下类型:    Type stutype        ino As Integer        stmame As String*20        strsex As String*1        smark As Single    End Type    在窗体上正确使用这个类型的是下列哪个操作(    )。

选项 A、Sub Command1_click()        Dimstudent As Stutype        With student        .ino=12        .strname=smith        .strsex=男        .smark=89        End With    End Sub
B、Sub Command1_Click()        Dim student As Stutype        With student        .ino=12        .strname="smith"        .strsex="男"        .smark=89        End With    End Sub
C、Sub Command1_Click()        Dim student As Stutype        With Stutype        .ino=12        .strname="smith"        .strsex="男"        .smark=89        End With    End Sub
D、Sub Command1_click()        Dim student As Stutype        With student        .ino=12        .strname="smith"        .strsex="男"        .smark=89        End student    End Sub

答案2

解析 本题考查为记录类型变量student赋值。使用With语句可以对某个对象执行一系列的语句,而不用重复指出对象的名称。其语法如下:
   With记录类型变量
   .记录类型变量成员名=要赋的值
   …
   End With
   给记录类型变量中的字符串型成员赋值时要加双引号。
转载请注明原文地址:https://kaotiyun.com/show/Da1p777K
0

最新回复(0)