首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: 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
2020-07-22
70
问题
设在工程中有一个标准模块,并定义了如下类型:
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:.strname="smith":
.strsex="男":.smark=89
End With
Open"c:\Student.dat"For Input As #1 Len
=Len(Student)
Put #1,record_no,Student
Close #1
End Sub
B、Sub CommandI_Click()
Dim Student As Stutype
Dim Record_no As Integer
Record no=1
With Student
Ano=12:.strname="smith"
.strsex="男":.smark=89
EndWith
Open"c:\student.dat"ForRandomAs #1
Len=Len(Student)
Put #1,Record no,Student
Close #1
End Sub
C、Private Sub Command1_Click()
Dim Student As Smtype
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 Command1_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 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/gcHp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
能够用于标识对象名称的属性是
以下不能用形状控件画出的图形是
下列叙述中正确的是()。
VB中,若没有显式声明变量的数据类型,则默认的类型是
下列叙述中正确的是
设窗体上有一个列表框控件List1,含有若干列表项。以下能表示当前被选中的列表项内容的是
下列叙述中正确的是()。
从工程管理角度看,软件设计一般分为两步完成,它们是
表达式12/2\4的值是
软件生存周期中,解决软件“做什么”的阶段是()。
随机试题
国际经济法的基本原则不包括()
反映企业发展能力的首要指标是
阿莫西林主要用于治疗
A.不易被吸附,Rf大B.均易被吸附,Rf相同C.均难被吸附,Rf极大D.易被吸附,Rf小E.均易被吸附,Rf极小
收购、加工、使用毒性药品的单位必须建立健全的制度有()
通过调整物质利益进而对个人和企业经济行为的调节来引导国民经济的运行,是财政政策的()功能。
在组织论中运用( )可以很清晰地表达和反映组织关系。
( )是指证券公司为本公司买卖证券,赚取差价并承担相应风险的行为。
一家外商投资企业立项审批历时11个月,修改立项报批的文件资料合计300多万字,耗费纸张503公斤.经办人员行程2万多公里,在途27个通宵,费用达4万元。1990年6月,浙江省黄岩微型电机厂、金清购销服务部与香港峻诚企业有限公司合资筹办“金港塑料薄膜制品有限
教育的根本目的是()
最新回复
(
0
)