首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmame As String*20 strsex As String*2 smarkAs Single End Type 在窗体上画一个名为Comma
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmame As String*20 strsex As String*2 smarkAs Single End Type 在窗体上画一个名为Comma
admin
2020-06-30
73
问题
设在工程中有一个标准模块,并定义了如下类型:
Type Stutype
ino As Integer
stmame As String*20
strsex As String*2
smarkAs Single
End Type
在窗体上画一个名为Commandl的命令按钮,要求当执行事件过程Commandl Click时,在C盘根目录下的随机文件Student.dat中写入一条记录。下列能够完成该操作的是( )。
选项
A、Sub Commandl_Click( )
Dim student As Studtype
Dim record_no As Integer
record_no=1
With student
.ino=12:.stmame=“smitll”:
.strsex=“男”:.smark=89
End With
Open”c:\Student.dat”ForInputAs#1 Len=
Len(Student)
Put#1,record_no,Student
Close#1
EndSub
B、Sub Commandl_click( )
Dim Student As Stutype
Dim Record_no As Integer
Record_no=1
With Student
.ino=12:.stmame=“smith”
.sffsex=“男”:.smark=89
End With
Open”c:\student.dat”For Random As#1 Len
=Len(Student)
Put#1,Record_no,Student
Close#1
EndSub
C、Private Sub Commandl_Click( )
Dim StudentAs 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)
Write#1,Record_no,Student
Close#1
End Sub
D、Sub Commandl_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 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://www.kaotiyun.com/show/RmHp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
假定有下面的程序:PrivateSubForm_Click()DimNAsIntegerN=InputBox("输入一个2位整数")Print(N-Int(N/10)*10)*10+Int(N/
编写如下程序:PrivateSubCommand1_Click()Fori=1To4PrintSpace(12-3*i);Forj=1ToiPrintj;
在窗体上画一个命令按钮,其名称为Command1,然后编写如下代码:OptionBase1PrivateSubCommand1_Click() Dima a=Array(1,2,3,4) j=1 Fori=4To1
窗体上有1个名称为Text1的文本框;1个名称为Timer1的计时器控件,其Interval属性值为5000,Enabled属性值是True。Timer1的事件过程如下:PrivateSubTimer1_Timer()Static
软件生命周期可分为定义阶段、开发阶段和维护阶段,下面不属于开发阶段任务的是
设有如下声明语句OptionBase1Dimart(2,-1To5)AsInteger则数组air中数组元素的个数是
有下面的函数过程:PrivateFunctionfun(strAsString,chAsString)AsIntegern=0Fork=1ToLen(str)IfMid(str,k
以下变量名中合法的是
窗体上有一个名称为Combol的组合框,为了引用Combol中最后一个列表项,应使用的表达式是
下面描述中不属于数据库系统特点的是()。
随机试题
为什么在日常生产中多采用指示仪表,而在实验室又多采用比较仪器?
试述呼吸衰竭的临床表现。
用来表示场地内的建筑物、道路、绿化等总体布置的建筑施工图是()。
地下水位上升将使土中自重应力减小的土层位置是:
隧道工程质量控制时,施工单位应对()等涉及结构安全和使用功能的分部工程及关键项目进行检验,监理单位按规定进行平行检验或见证取样检测。
车床的主轴箱属于车床的()。
[*]
公安机关作为党的忠实工具,必须认真实践全心全意为人民服务的宗旨,要求()
Dijkstra提出的银行家算法属于()。A)死锁预防B)死锁避免C)死锁检测D)死锁解除
WhathappenedtoPetelastFourthofJuly?FireworkseyeinjuriescanresultineachofthefollowingEXCEPT
最新回复
(
0
)