首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: 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
101
问题
设在工程中有一个标准模块,并定义了如下类型:
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全国计算机二级
相关试题推荐
某二叉树中度为2的结点有10个,则该二叉树中有()个叶子结点。
实现字符的UniCode编码方式与ANSI编码方式相互转换的函数是()。
下列方法中,不属于软件调试方法的是()。
软件设计中模块划分应遵循的准则是
以下合法的VB变量名是
在数据库设计中,将E-R图转换成关系数据模型的过程属于
假定已在窗体上画了多个控件,其中有一个被选中,为了在属性窗口中设置窗体的属性,预先应执行的操作是
以下能够正常结束循环操作的程序段是
设a=2,b=3,c=4,d=5,下列表达式的值是()。3>2*bOra=cAndb<>cOrb<>a+c
8.6787E+8写成普通的十进制数是()。
随机试题
如何取消巡航控制?
陈先生,66岁,护士为其测血压,为与第一次测量辨别,需重复测量,下述何项做法错误
建设工程项目实施阶段管理工作的主要任务是()。
关于买卖合同法律特征的表述中,不正确的是()。
在合理的劳动组织与合理使用机械的条件下,完成单位合格产品所必须消耗的施工机械工作时间不包括()。
当事人订立的质权合同一般包括的条款有()。
对于经营者从事的下列滥用市场支配地位的行为,反垄断执法机构进行违法性认定时,无需考虑行为是否有正当理由的是()。
经典条件反射理论关于学习的基本观点包括()
社区矫正对社会工作者介入司法过程,自司法判决前的()阶段就已经开始。
用MIPS衡量的计算机性能指标是()。
最新回复
(
0
)