首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: 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
95
问题
设在工程中有一个标准模块,并定义了如下类型:
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全国计算机二级
相关试题推荐
有三个关系R、S和T如下:则由关系R和S得到关系T的操作是
要将单选按钮Opt1设为被选中,应设置的属性是
执行以下程序段a$="VisualBasicProgramming":b$="C++"c$=UCase(Left$(a$,7))&b$&RightS(aS,12)变量c$的值为
以下关于变量作用域的叙述中错误的是
下列关于数据库设计的叙述中,正确的是
设有下列语句:x=5Ifx>0Theny=1y=5程序运行后,则下列叙述中正确的是()。
下列关于滚动条的叙述中,错误的是
产生100以内(不含100)2位随机整数的VisualBasic表达式是
下面可以产生20~30(含20和30)的随机整数的表达式是
以下能对正实数d的第3位小数四舍五入的表达式是
随机试题
桃核承气汤中没有的药物是
关于角化棘皮瘤描述不正确的是
孕妇在妊娠期间感染梅毒,对胎儿的影响是
对冯某应以什么罪定罪量刑?陆某的行为构成何罪?
混凝土应按国家现场标准《普通混凝土配合比设计规程》(JGJ55)的有关规定,根据混凝土()等要求进行配合比设计。
因违法违纪行为被吊销会计从业资格证书的人员,自被吊销会计从业资格证书之日起()年内,不得重新取得会计从业资格证书。
常用的评价成人超重和肥胖的体格测量指标包括()
“大五”人格结构模型中的五个因素是外倾性、开放性、情绪稳定性、宜人性和
左撇子的人比右撇子的人更容易患某些免疫失调症,例如过敏。然而,左撇子也有优于右撇子的地方,例如,左撇子更擅长于由右脑半球执行的工作。而人的数学推理的工作一般是由右脑半球执行的。从上述断定能推出以下哪个结论?I.患有过敏或其他免疫失调症的
Whatdoesthehamburgersayaboutourmodernfoodeconomy?Alot,actually.OverthepastseveralyearsWaldoJaquithintendedt
最新回复
(
0
)