首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmame As String*20 strsex As String*2 smarkAs Single End Type 在窗体上画一个名为Comma
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmame As String*20 strsex As String*2 smarkAs Single End Type 在窗体上画一个名为Comma
admin
2020-06-30
67
问题
设在工程中有一个标准模块,并定义了如下类型:
Type Stutype
ino As Integer
stmame As String*20
strsex As String*2
smarkAs Single
End Type
在窗体上画一个名为Commandl的命令按钮,要求当执行事件过程Commandl Click时,在C盘根目录下的随机文件Student.dat中写入一条记录。下列能够完成该操作的是( )。
选项
A、Sub Commandl_Click( )
Dim student As Studtype
Dim record_no As Integer
record_no=1
With student
.ino=12:.stmame=“smitll”:
.strsex=“男”:.smark=89
End With
Open”c:\Student.dat”ForInputAs#1 Len=
Len(Student)
Put#1,record_no,Student
Close#1
EndSub
B、Sub Commandl_click( )
Dim Student As Stutype
Dim Record_no As Integer
Record_no=1
With Student
.ino=12:.stmame=“smith”
.sffsex=“男”:.smark=89
End With
Open”c:\student.dat”For Random As#1 Len
=Len(Student)
Put#1,Record_no,Student
Close#1
EndSub
C、Private Sub Commandl_Click( )
Dim StudentAs Stutype
Dim Record_no As Integer
Record_no=1
With Student
.ino=12:.strname=“smith”
.strsex=“男”:.smark=89
EndWith
Open”c:\student.dat”For Random As 1 Len=
Len(Student)
Write#1,Record_no,Student
Close#1
End Sub
D、Sub Commandl_Click( )
Dim StudentAs Stutype
Dim Record_no As Integer
Record_no=1
With Student
.ino=12:.stmame=“smith”
.strsex=“男”:.smark=89
End With
Open”c:\student.dat”For Output As #1 Len=
Len(Student)
Put#1,Record_no,Student
Close#1
End Sub
答案
B
解析
考查文件操作。题目中要求以随机的方式(Random)打开一个文件,打开文件的方法格式为:Open FileName For Random As#文件号[Len=记录长度],然后以Put方法写入一条记录,方法的格式为:Put[#]文件号,[记录号],变量名。
转载请注明原文地址:https://kaotiyun.com/show/RmHp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
在窗体上画一个命令按钮,然后编写如下时间过程()。PrintSubCommand1_Click()a=InputBox("EntertheFirstinterger")b=InputBox("Enterth
以下不能输出"Program"的语句是( )。
假定有下面的程序:PrivateSubForm_Click()DimNAsIntegerN=InputBox("输入一个2位整数")Print(N-Int(N/10)*10)*10+Int(N/
确定一个控件在窗体上的位置的属性是()。
关于菜单设计,下列叙述中错误的是()。
耦合性和内聚性是对模块独立性度量的两个标准。下列叙述中正确的是( )。
下列叙述中正确的是( )。
下面程序执行时,输出的结果是()。PrivateSubForm_Click()DimiAsInteger,jAsIntegeri=10Doi=i+jForj=10Toi
数据库技术的根本目标是要解决数据的
在E-R图中.用来表示属性的图形是()。
随机试题
由许多文化集丛结合而成的一个文化整体,而与其他文化模式互相区别,被称为()
鉴相器的作用及其组成是什么?
为研究外源性雌激素与子宫内膜癌的关系,某地展开了一项1:1匹配的病例对照研究,结果见下表:请对以上资料进行分析。
慢性肾功能不全之阴阳两虚证治宜()
A.清营汤B.化斑汤C.白虎汤D.苇茎汤E.止嗽散治疗肺炎咳吐黄稠脓痰者,应首选
变异型心绞痛,不宜使用
在施工过程中,施工人员发现设计图纸不符合技术标准,施工单位技术负责人采取的正确做法是()。【2009年考试真题】
某增值税一般纳税企业单独设置了“预收账款”和“预付账款”账户。2008年5月,该企业发生下列经济业务:(1)5日,收到N公司预付的购货款34000元,已存入银行。(2)10日,收到M公司货物结算单,其中材料价款50000元,增值税8
以下关于MsgBox的叙述中,错误的是
AccordingtoWorldHealthOrganization,howmanypeopleamkilledbyoutdoorairpollution?Whatdolocalresidentsclaimfor?
最新回复
(
0
)