首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmameAs String*20 strsexAs String*2 smark As Single
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmameAs String*20 strsexAs String*2 smark As Single
admin
2016-03-21
70
问题
设在工程中有一个标准模块,并定义了如下类型:
Type Stutype
ino As Integer
stmameAs String*20
strsexAs String*2
smark As Single
EndType
在窗体上画一个名为Commandl的命令按钮,要求当执行事件过程Commandl Click时,在C盘根目录下的随机文件Student.dat中写入一条记录。下列能够完成该操作的是( )。
选项
A、Sub Command 1_Click()
Dim student As Studtype
Dim record_no As Integer
record no=l
With student
ino=12:strname=“smith”:
strsex=“男”:smark=89
EndWith
Open“c:\Student.dat”For Input As#1 Len=
Len(Student)
Put#1.record no.Student
Close#1
End Sub
B、Sub Command 1 Click()
Dim Student As Stutype
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 no,Student
Close#1
End Sub
C、Private Sub Commandt 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 Random As 1 Len=
Len(Student)
Write
D、Sub Commandl—Click()
Dim Student As Stutype
Dim Record——no As Integer
Record—no=1
With Student
.ino=12:.strname=“smith”
.strsex=“男”:.smark=89
EndWith
Open“c:\student.dat”For Output As#1 Len=
Len(Student)
Put#1,Recor
答案
B
解析
本题考查文件操作。题目中要求以随机的方式(Random)打开一个文件,打开文件的方法格式为:0pen File NameForRandomAs#文件号[Len=记录长度],然后以Put方法写入一条记录,方法的格式为:Put[#]文件号,[记录号],变量名。
转载请注明原文地址:https://kaotiyun.com/show/egLp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
下列程序段的输出结果是()。A=0PrintA+1A=3
在面向对象方法中,信息隐蔽是通过对象的【】性来实现的。
要把一个命令按钮设置成无效,应设置属性______的值为False。
在命令按钮上释放鼠标按钮时,所触发的事件称为______。
以下关于窗体的描述中,错误的是()。
下列不属于VisualBasic特点的是()。
如果将文本框的Locked属性设置为True,则以下说法正确的是
设y是整形变量,能判断y为奇数的表达式是
在进行关系数据库的逻辑设计时,E—R图中的属性常被转换为关系中的属性,联系通常被转换为【5】。
设有关系R和s,关系代数表达式为R-(R-S)表示的是
随机试题
安装电动机功率应与泵轴功率一致。
权力观念体现了领导干部的
下列关于分公司法律地位的表述中,正确的有()。
了解到项目组成员A和审计客户X公司的高级管理人员B均为z公司的股东后,U事务所认为这一情况对A的独立性产生严重不利影响。在采取的以下防范措施中,你认为最适当的是()。
注册会计师充分了解专家的专长领域,主要是为了()。
在录用人民警察的程序中第一条就是要发布报考公告,报考公告应在考试前一定时间,通过公安机关内部通知的形式,让报考者有所准备。()
1.近日,国家主席习近平前往荷兰,开启他就任中国最高领导人以来首次访欧之旅,除了政治经济议题,习近平主席和夫人彭丽嫒身着中式服装出席荷兰国王威廉.亚历山大举行的国宴,也引起人们的注意。在古老的阿姆斯特丹王宫里,习近平夫妇的“中国风”装扮,与荷兰
下列各句中,没有语病的一句是()。
Whatisthewoman’sattitudetowardtheman’sjoiningtheschoolfootballteam?
A、Shedoesn’tlivefaraway.B、Shewon’tbuyacarthisyear.C、Shehasn’tmadeuphermind.D、Shedoesn’tliketodrive.BM:Ar
最新回复
(
0
)