首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer strname As String*20 strsex As String*2 smark As Single End Type 在窗体上画一个名为Com
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer strname As String*20 strsex As String*2 smark As Single End Type 在窗体上画一个名为Com
admin
2019-06-20
91
问题
设在工程中有一个标准模块,并定义了如下类型:
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
Dim record_no As Integer
record_no=1
With student
.ino=12:.stmame="smith"
.strsex="男":.smark=89
End With
Open"c:\Student.dat"For Input As#1Len
=Len(Student)
Put#1,record_no,Student
Close#1
End Sub
B、Sub Command1_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 Random As#1
Len=Len(Student)
Put#1.Record no,Student
Close#1
End Sub
C、Private Sub Command1_Click()
Dim Student As Stutype
Dim Record_no As Integer
Record_no=1
Wim Student
.ino=12:.stmame="smith"
.strsex="男":.smark=89
End Wim
Open"c:\student.dat"For Random As1
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
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 File Name For Random As撑文件号[Len=记录长度],然后以Put方法写入一条记录,方法的格式为:Put[#]文件号,[记录号],变量名。
转载请注明原文地址:https://kaotiyun.com/show/ffUp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
下列选项中,不属于数据库管理的是()。
下列程序的执行结果为()。A="5":B="6"A=VaI(A)+VaI(B)B=Vaf("56")IfABThenPrintA-BElsePrintB-A
下面有关标准模块的叙述中,错误的是()。
设计窗体时双击窗体的任何位置,将打开()。
以下关于函数过程的叙述中,正确的是
如果要将一个窗体从内存中清除,应使用的语句是
以下关于事件、事件驱动的叙述中,错误的是
在窗体上画一个文本框,名称为Text1(可显示多行),然后冉画三个命令按钮,名称分别为Command1、Command2和Command3,标题分别为“读数”、“统计’,和“存盘”,如图2.67所示。程序的其功能是:单击“读数”按钮,则把考生目录下的in5
设a=2,b=3,c=4,d=5,下列表达式的值是()。3>2*bOra=cAndb<>cOrb<>a+c
检查软件产品是否符合需求定义的过程称为
随机试题
Humanneedsseemendless.Whenahungrymangetsameal,hebeginstothinkaboutanovercoat;whenamanagergetsanewsports
龋病二级预防的内容不包括
某女,45岁。双膝、踝关节疼痛不舒4年。近1周病情加重,四肢关节红肿热痛,发热,皮下结节,环形红斑。血沉40mm/h,抗“O”>500。诊断为
某企业排水量0.3m3/s,排放标准为60mg/L,河流设计流量为1.5m3/s,某污染物环境质量标准为30mg/L,其在河流中占标率为70%,河流完全混合,不考虑污染物的降解,需要预留10%的安全余量,该项目排水的最大浓度为()mg/
项目建设实施活动的领导者是()。
可燃气体检测器和有毒气体检测器的安装位置应根据被测气体的()确定。
实行投资抵免企业所得税的国产设备,企业可就未予抵免所得税的投资额作为设备原价计提折旧,已予抵免的部分不得计提折旧在税前扣除。()
按照贷款五级分类的方法,下列属于不良贷款的是()。
嵩山少林寺是为了安顿印度僧人()居住传法而建的。
开元十四年,唐政府在黑水靺鞨设立了()。
最新回复
(
0
)