首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino AS Integer strname As String*20 strsex AS String*2 smark As Single
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino AS Integer strname As String*20 strsex AS String*2 smark As Single
admin
2019-06-11
59
问题
设在工程中有一个标准模块,并定义了如下类型:
Type Stutype
ino AS Integer
strname As String*20
strsex AS String*2
smark As Single
End Type
在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1 Click时,在C盘根目录下的随机文件Student.dat中写入一条记录。下列能够完成该操作的是( )。
选项
A、Sub Command1_Click( )
Dim student As Studtype
Dimrecord_no As Integer
record_no=1
With student
.ino=12:.stmame="smith":
.strsex="男":.smark=89
End With
Open"c:\Studont.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 Command 1_Click( )
Dim Student As 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#1,Record_no,Student
Close#1
End Sub
D、Sub Command1_Click( )
Dim Student As Stutype
Dim Record_no As Integer
Record_no=1
With Student
.ino=12:.stmame="smith"
.strsex="男":.smark=89
EndWith
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/gyUp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
设有如下关系表:则下列操作中正确的是
设窗体中有一个文本框Text1,若在程序中执行了Text1.SetFocus,则触发
以下关于变量作用域的叙述中错误的是
有数据定义语句:DimX,YAsInteger以上语句表明
有如下语句序列:Dima,bAsIntegerPrintaPrintb执行以上语句序列,下列叙述中错误的是
下列关于线性表的叙述中,不正确的是()。
表达式2*3^2+4*2/2+3^2的值是
一棵二叉树中共有70个叶子结点与80个度为1的结点,则该二叉树中的总结点数为
能够产生1到50之间(含1和50)随机整数的表达式是
以下能对正实数d的第3位小数四舍五入的表达式是
随机试题
交通事故当事人逃逸造成证据丢失,逃逸当事人承担事故全部责任。
在PowerPoint2010各种视图中,可以同时浏览多张幻灯片,便于重新排序、添加、删除等操作的视图是____。
《香市》中写道“社庙的左屋被‘公安分局’借去做了衙门”,“社庙的左偏殿上又有什么‘蚕种改良所’的招牌”。这里运用的表现手法是()
A.乙肝五项为HBsAg、HBeAg、抗-HBc阳性B.抗-HBs、抗-HBe、抗-H1Bc阳性,HBV-DNA阴性C.抗-HBs阳性D.抗-HAVIgM阴性,抗-HAVIgG阳性E.HBsAg、抗-HBc阳性,抗-HCV阳性接种过
墙体下的刚性条形混凝土(C15)基础如图所示。当基础厚度为H时,则台阶宽度b的最大尺寸为()。
方程5x2+6y2-z2=1表示()。
甲房地产开发公司(以下简称“甲公司”)对其新开发的楼盘进行预售,其在销售广告中说明,该楼盘为高品质生活小区,小区空地绿化面积高达70%,温泉水人户。该小区因这两项条件比较优越,销售均价比同区域的其他小区高出20%。李某对甲公司销售广告中的内容十分认可,于2
“价格革命”之所以加速了西欧封建制度的衰落和资本主义的发展,是因为它()①使新兴资产阶级的经济力量增大②使靠固定地租收入的封建主地位削弱③使传统商路和贸易中心转移④使城乡雇佣工人人数增多且日益贫困
DorothylookedattheKingwhensheheardthissongandnoticedthatheseemeddisturbedand______atease.
A、Arrangeonemoreinterview.B、OfferthejobtoDavidWallace.C、Reportthemattertotheirboss.D、HireBarbaraJonesonatri
最新回复
(
0
)