首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: 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
90
问题
设在工程中有一个标准模块,并定义了如下类型:
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的操作是
能够存放组合框的所有项目内容的属性是
窗体上有一个Text1文本框,一个Command1命令按钮,并有以下程序:PrivateSubCommand1_click()DimnIfText1.Text<>"123456"Thenn=n+1:Print"口令输入错误"&n&"次"E
双精度浮点数的类型说明符为
在窗体上有一个名称为Drivel的驱动器列表框,一个名称为Dirl的目录列表框,一个名称为Filel的文件列表框,两个名称分别为Label1、Label2的标签(标题分别为空白和“共有文件”)。要使得驱动器列表框与目录列表框、目录列表框与文件列表框同步变化
下列关于线性表的叙述中,不正确的是()。
双精度浮点数的类型说明符为
设树T的深度为4,其中度为1,2,3,4的结点个数分别为4,2,1,1。则T中的叶子结点数为
产生100以内(不含100)2位随机整数的VisualBasic表达式是
随机试题
科学发展观的根本方法是()
《中国医学文摘》(护理学分册)可以使用的检索途径包括()
李某把自己的房屋卖给张某,双方协商同意,以30000己成交,这一房屋买卖合同()
MDS患者贫血特征为
范登伯氏试验呈双向反应的是
某医师调查到两地区肝癌的死亡率,对其比较应考虑
下列应当记入固定资产原始价值核算的是()。
分封制是西周的一种重要政治制度,西周初年分封了许多诸侯国,下列诸侯国属于西周初年分封的是()。
富强对于()相当于()对于社会
PressingOilfromSeeds【T1】______byusingpressure.Amachine【T2】______isoftenused.Thefirststepinpressingtheoilfr
最新回复
(
0
)