首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: 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
68
问题
设在工程中有一个标准模块,并定义了如下类型:
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://www.kaotiyun.com/show/egLp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
结构化程序设计的核心和基础是()。
下面叙述中正确的是______。
以下控件可以用来实现定时地执行某段代码的是______。
假定有如下的窗体事件过程:PrivateSubForm_Click()a$="MicrosoftVisualBasic"b$=Right(a$,5)c$=Mid(a$,1,9)MsgBoxa$,34,b$,c
文本框的ScrollBars属性设置为非零值,却没有效果,原因是()。
有如下SUB过程:Subs(xAsSingle,yAsSingle)t=xx=t/yy=tModyEndSub在窗体上添加一个命令按钮,然后编写如下事件过程:PrivateSubF
如果将文本框的Locked属性设置为True,则以下说法正确的是
在窗体上画一个名称为List1的列表框,列表框中显示若干城市的名称。当单击列表框中的某个城市名时,该城市名消失。下列在List1_Click事件过程中能正确实现上述功能的语句是
双击窗体中的对象后,VisualBasic将显示的窗口是
随机试题
某工程划分为3个施工过程在5个施工流水段组织加快的成倍节拍流水施工,流水节拍值分别为4D,2D,6d,该工程的施工总工期为()d。
患者女性,50岁,主动脉瓣关闭不全病史25年,PDE示重度反流。如能听到AustinFlint杂音,该杂音为
A.阴B.阳C.阴中之阳D.阳中之阴E.阴中之阴
A.糖苷键B.疏水堆积力C.氢键D.3’,5’—磷酸二酯键E.Β-折叠维持DNA双链结构纵向稳定性的是
新生儿硬肿症的发生顺序为
根据《劳动法》,下列关于妇女、未成年人劳动保护的说法,正确的有()。
下列费用中,应计入建筑安装工程施工机具使用费的有()。
阿克姆厂的审计员:上周在阿克姆面包厂的夜班中,烤制的面包有6%发现有问题,而在白班中却没有发现有问题的面包。面包在被烤制的同一天接受检查,所以,夜班监控质量的质检员明显地比白天的质检员更警觉,尽管他们在夜间工作。上述论证依赖于以下哪项假设?
Whatarethesepeopleplanningtodo?
Whatdoesthespeakerdomostprobably?
最新回复
(
0
)