首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmame As String*20 strsex As String*2 smark As Single
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmame As String*20 strsex As String*2 smark As Single
admin
2020-07-22
25
问题
设在工程中有一个标准模块,并定义了如下类型:
Type Stutype
ino As Integer
stmame 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
EndWith
Open"c:\Student.dat"For Input As #1 Len= Len(Student)
Put#1,record_no,Student
Close #1
End Sub
B、Sub Command1_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 Random As#1 Len=Len(Student)
Put#1,Record_no.Student
Close #1
End Sub
C、Private 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 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
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/BrHp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
在VB中,函数过程与子程序过程的区别之一是
将数据项"Student"添加到名称为List1的列表框中,并使其成为列表框第一项的语句为( )。
对关系S和关系R进行集合运算,结果中既包含关系S中的所有元组也包含关系R中的所有元组,这样的集合运算称为()。
如果要在窗体上画一个标签,应在工具箱窗口中选择的图标是( )。
为了使命令按钮的Picture、DownPicture或DisabledPicture属性生效,必须把它的Style属性设置为( )。
一个教师可讲授多门课程,一门课程可由多个教师讲授。则实体教师和课程间的联系是( )。
将E-R图转换到关系模式时,实体与联系都可以表示成()。
以下关于VB文件的叙述中,正确的是
假定有以下循环结构:DoUntil条件表达式循环体Loop则以下正确的描述是()。
有下面程序代码:PrivateSubCommand1_Click()a=3s=0Fork=1To5s=s+aModka=a+kNextkPrintsEndSub程序运行后,单击命令按钮Command1,输出结果是(
随机试题
自底向上测试方法的主要优点是不需要测试驱动程序,能够在测试阶段的早期实现并验证系统的主要功能。()
关节脱位的专有体征是
具有镇痛作用的药物是
采购流程中的关键控制点主要是:()和进货确认及付款。
社区卫生服务机构是一个()。
事后监督,是指监督主体在公安机关及其人民警察执法行为终结之后进行的监督,如行政复议、行政诉讼、督察监督等。事后监督是对执法行为的后果进行的监督。()
进入6月份,不少市民发现,蚊子越来越多,简直无法控制,灭蚊剂也杀不死,一些曾经“一用就灵”的灭蚊剂如今渐渐失效。在武汉的各大医院皮肤科被蚊虫叮咬的儿童患者挤满了病房。以下哪项不是这一现象出现的原因?()
强化是指不断通过改变环境的刺激因素来达到增强、减弱或消除某种行为的过程。按强化的性质和目的分,一般有正强化、负强化、惩罚、自然消退四种强化方式。负强化是指某一行为之后不再伴有某种不利结果,如努力工作后不再追究以前的过错。下列属于负强化的是(
某市为加强道路交通管理,规范日益混乱的交通秩序,决定出台一项新举措,由交通主管部门向市民发布公告,凡自行摄录下机动车辆违章行驶、停放的照片、录像资料,送经交通部门确定后,被采用并在当地电视台播出的,一律奖励人民币500元至1000元。此举使许多市民踊跃参与
A、Changingtheobstaclesintoopportunities.B、Findinghopethroughparents.C、Spottingeveryopportunity.D、Overcomingallthe
最新回复
(
0
)