首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmameAs String*20 strsexAs String*2 smark As Single
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmameAs String*20 strsexAs String*2 smark As Single
admin
2016-03-21
49
问题
设在工程中有一个标准模块,并定义了如下类型:
Type Stutype
ino As Integer
stmameAs String*20
strsexAs String*2
smark As Single
EndType
在窗体上画一个名为Commandl的命令按钮,要求当执行事件过程Commandl Click时,在C盘根目录下的随机文件Student.dat中写入一条记录。下列能够完成该操作的是( )。
选项
A、Sub Command 1_Click()
Dim student As Studtype
Dim record_no As Integer
record no=l
With student
ino=12:strname=“smith”:
strsex=“男”:smark=89
EndWith
Open“c:\Student.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 Commandt 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 Random As 1 Len=
Len(Student)
Write
D、Sub Commandl—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 Output As#1 Len=
Len(Student)
Put#1,Recor
答案
B
解析
本题考查文件操作。题目中要求以随机的方式(Random)打开一个文件,打开文件的方法格式为:0pen File NameForRandomAs#文件号[Len=记录长度],然后以Put方法写入一条记录,方法的格式为:Put[#]文件号,[记录号],变量名。
转载请注明原文地址:https://kaotiyun.com/show/egLp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
在面向对象方法中,信息隐蔽是通过对象的【】性来实现的。
下列程序段的执行结果为______。Dimm(3,3)AsIntegerDimiAsIntegerDimjAsIntegerDimxAsIntegerFori=1To3m
在窗体上画四个文本框(如下图所示),并用这四个文本框建立一个控件数组,名称为Text1(下标从0开始,自左至右顺序增大),然后编写如下事件过程PrivateSubCommandl_Click()ForEachTextBoxin
随机文件以【】为单位读写。
下列程序用来计算1+2+…n,当和大于100时停止计算,请填空。PrivateSubForm_Click()Dimnasinteger,sasinteger,Iasinteger,kasintegers=0k=0n=
在窗体上画一个命令按钮,然后编写如下事件过程:PrivateSubCommand1_Click()Fori=1To4x=4Forj=1To2x=x+6NextNextPrintxEndSub程序运
要触发组合框的DblClick事件,只有将组合框的Style属性设置为
假定用下面的语句打开文件:Open“Filel.txt”forInputAs#1则不能正确读文件的语句是
软件按功能可以分为应用软件、系统软件和支撑软件(或工具软件)。下面属于应用软件的是
如果x是一个正的实数,将千分位四舍五入,保留两位小数的表达式是()。
随机试题
女,50岁。胸痛、反酸、胃灼热、嗳气3个月,胃镜检查食管黏膜未见明显异常,最有助于明确诊断的检查是()
A.CVPB.PAWPC.MAPD.PCWPE.MPAP能评估左心室泵血功能、器官和组织血流情况的指标是
下列除哪项外,均属于发病的外环境
下列各项中不属于我国统计职能的是()。[2014年中级真题]
一般要求百年一遇洪水位以上()m的地段,可选作城市用地。
如果持票人未在法定期限内为付款提示的,则丧失对其前手和承兑人的追索权。()
关于我国现代史,以下说法不正确的是()。
1.01,2.02,2.03,3.05,_____________( )
世界杯期间,法国足球队有替补队员参与了罢训事件。如果上述判断为真,则以下哪项不能确定真假?Ⅰ.法国足球队的替补队员尼尔参与了罢训事件。Ⅱ.法国足球队有的替补队员没有参与罢训事件。Ⅲ.法国足球队全体队员都没有参与罢训事件。Ⅳ.法国足球队没有任何替补队
在SQL中,实现事务的提交的语言是______。
最新回复
(
0
)