设在工程中有一个标准模块,其中定义了如下类型: Type stutype ino As Integer strname As String*20 strsex As String*1 smark As Single End Type 在窗体上画一个名为Connnand1的命令按钮,要求当执行事件过程Command1_Click时,在c:\的随机文件student..dat写入一条记录。下列能够完成该操作的事件过程是( )。A.Sub Command1_C1ick() Dim student As stud

题目

设在工程中有一个标准模块,其中定义了如下类型: Type stutype ino As Integer strname As String*20 strsex As String*1 smark As Single End Type 在窗体上画一个名为Connnand1的命令按钮,要求当执行事件过程Command1_Click时,在c:\的随机文件student..dat写入一条记录。下列能够完成该操作的事件过程是( )。

A.Sub Command1_C1ick() Dim student As studtype Dim record_no As Integer record_no=1 With student .ino=12 .strname="smith" .strsex="男" .smark=89 End With Open" c:\student.dat" For input As # 1 len=len(student) Put # 1,record_

B.Sub Command1_Click( ) Dim student As studtype Dim record_no As Integer record_no=1 With student .ino=12 .strname="smith" .strsex="男" .smark=89 End With Open"c:\student.dat" For random As #1 len=len(student) Put #1,record_n

C.Sub Command1_Click() Dim student As studtype Dim record_no As integer record_no=1 With student .ino=12 .stmame="smith" .strsex="男" .smark=89 End With Open"c:\student.dat" For random As #1 len=len(student) Write #1,record_n

D.Sub Command1_Click() Dim Student As studtype Dim Record_no As Integer record_no=1 With student .ino=12 .strname="smith" .strsex="男" .smark=89 End With Open"c:\student.dat"For output As #1 len=len(student) Put #1,record_no,


相似考题
更多“设在工程中有一个标准模块,其中定义了如下类型:Type stutypeino As Integerstrname As String*20 ”相关问题
  • 第1题:

    设在工程文件中有一个标准模块,其中定义了下列记录类型:

    Type Books

    Name As String*10

    TelNum As String*20

    End,Type

    在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1 Click 时,在顺序文件Person.txt中写入一条Books类型的记录。下列能够完成该操作的事件过程是( )。

    A.Private Sub Command1 Click( )

    Dim B AS Books

    Open"Person txt"For Output As#1

    Name=InputBox(”输入姓名”)

    relNum=lnputBox(”输入电话号码”)

    Wlite#1 B Name,B TelNum

    Ch,se#1

    End Sub

    B.Private Sub Command1 Click( )

    Dim B AS Books

    Open"Person txt"For Input As#1

    >Name=InputBox("输入姓名")

    TelNum=InputBox("输入电话号码")

    Print#1,B.Name,B.TelNam

    Close#1

    End Sub

    C.Private Sub Command1 Click( )

    Dim BAS Books

    Open"Person txt"For Output As#1

    Name=InputBox("输入姓名")

    TelNum=InputBox("输入电话号码")

    Write#1,B

    Close#1

    End Sub

    D.Private Sub Commandl Click( )

    Open"Person txt"For Input As#1

    Name=lnputBox("输入姓名")

    TelNum=lnputBox("输入电话号码")

    Prim#1 Name TelNum

    Close#1

    End Sub


    正确答案:A
    A。【解析】Type语句用于在模块级别(过程外的任何代码都被看作模块级别代码,必须先列出声明,随后列出过程)中定义一个用户自己的数据类型,本质上是一个数据类型集合,它含有一个至一个以上的成员。每个成员可以被定义为不同的数据类型。当声明自定义类型变量后,可通过“变量名.成员名”来访问自定义变量中的元素。VisualBasic程序中关于文件的操作,主要是先打开一个文件,然后对这个文件进行读或写的操作,操作完成后,关闭这个文件。打开文件的基本格式为:OpenFileNameForModeAs#FileNumber。打开方式主要有Output、Append、Input、Random等几种,Output、Append、Input方式打开的文件进行的读写操作都是以顺序方式进行的,其中Output、Append打开的文件主要用来输出数据,与Print#、Write#等方法配合使用;以Input方式打开的:(件主要用来读入数据,它与Input#、LineInput#语句配合使用。本题中,选项B和选项D均是以Input方式打开文件,显然错误,选项C中向顺序文件中写入记录的语句错误,正确答案只有选项A。

  • 第2题:

    假定已经定义了一个名为arr_type的PL/SQL表类型,那么怎样实例化一个arr_type类型的变量()

    A.v_arr arr_type;

    B.v_arr is arr_type;

    C.v_arr of arr_type;

    D.v_arr arr_type%type;


    参考答案:A

  • 第3题:

    如果希望想为表单元素类型为type且值为text的元素设置背景色,则用如下方法定义()。

    A.input{type=text}{ }

    B.input[type=text]{ }

    C.input(type=text){ }

    D.input type=text{ }


    hidden

  • 第4题:

    LTE中有两种无线帧类型type1和type2 ,其中type1用于TDD。()


    答案×

  • 第5题:

    若要定义全局的结构类型,应在其中定义的模块是 ( )。

    A.启动窗体

    B.标准模块

    C.类模块

    D.窗体级模块


    正确答案:B
    全局结构类型应在标准模块中定义。

  • 第6题:

    定义名为“联系方式”的属性组,该属性组包含两个名称分别为“邮箱”和“电话”的属性,这两个属性的类型均为"string",下面正确的选项为()。

    A.<attributeGroup name="联系方式"> <attribute name="邮箱" type="xsd:string"/> <attribute name="电话" type=“xsd:string"/> </attributeGroup>

    B.<attributeGroup name="联系方式"> <attribute name="邮箱" type="xsd:sting"> <attribute name="电话" type=“xsd:sting"> </attributeGroup>

    C.<attribute name="联系方式"> <attribute name="邮箱" type="xsd:sting"/> <attribute name="电话" type=“xsd:sting"/> <


    B 解析:实体联系模型中,联系指的是实体之间的联系,实体之间的联系有一对一、一对多和多对多3种。如:一个公司有一个经理,而每个经理只在一个公司任职,则公司与经理之间是一对一联系;一个公司有多个副经理,而每个副经理只在一个公司任职,则公司与副经理之间是一对多联系;一个老师可以有多个学生,而一个学生也可以有多个老师,则老师与学生之间是多对多的联系。联系可以同一个或多个实体有关。利用ER模型进行数据库的概念设计,分为3步:第1步设计局部的ER模型;第2步综合各个局部ER模型成为全局的ER模型;第3步对全局的ER模型进行优化,得到最终的ER模型。ER模型向关系模式的转换依据:把一个实体类型转移为一个关系模式,相应实体的属性转换为对应的关系的属性,实体的键是关系的键;把一个联系类型转换为一个关系模式,所有与该联系相关的实体的键及联系的属性转换成关系的属性,关系模式的键由实体与实体之间的联系所决定。