首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: 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
67
问题
设在工程中有一个标准模块,并定义了如下类型:
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全国计算机二级
相关试题推荐
线性表的顺序存储结构和线性表的链式存储结构分别是______。
代码窗口分为左右两栏,左边一栏称为______,右边一栏称为过程框。
在窗体上有1个名称为Commandl的命令按钮,并有如下事件过程和函数过程:PrivateSubCommandlClick()DimPAsIntegerp=m(1)+m(2)+m(3)Print
以下关于顺序文件的叙述中,正确的是
在数据库设计中,将E-R图转换成关系数据模型的过程属于
如果x是一个正的实数,将千分位四舍五入,保留两位小数的表达式是()。
对象是既包含数据又包含对______的方法,并将其封装起来的一个逻辑实体。
通常,将软件产品从提出、实现、使用维护到停止使用退役的过程称为_________。
检查软件产品是否符合需求定义的过程称为
随机试题
以下关于建设程序的主要内容叙述不正确的是()
干旱会造成粮食歉收,使得粮食的供给曲线()
A.Perthes试验B.Trendelenburg试验C.Pratt试验D.Branham征E.5P征急性动脉栓塞的临床表现是
50岁妇女,绝经后1年,接触性出血2个月,宫颈涂片Ⅳ级来诊,确诊首选辅助检查方法是
预防口腔疾病的口腔自我保健方法是
下列应当按《水利工程设计概(估)算编制规定》编制的有()。
请从所给的四个选项中,选择最合适的一个填入问号处,使之呈现一定的规律性。()
三个容积相同的瓶子里装满了酒精溶液,酒精与水的比分别是2:1,3:1,4:1。当把三瓶酒精溶液混合后.酒精与水的比是多少?
AsiansseetheUnitedStateslosingitsundisputedinternationalinfluencein50yearstopossiblyChinaamidwaningtrustinWa
Onceuponatime,abusinessmannamedRayKrocdiscoveredarestaurantownedbytwobrothers.Therestaurant【S1】______justfou
最新回复
(
0
)