首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: 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
27
问题
设在工程中有一个标准模块,并定义了如下类型:
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://jikaoti.com/ti/fgS0FFFM
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
设有如下通用过程:PublicFunctionf(xAsInteger) DimyAsInteger x=20 y=2 f=x*yEndFunction在窗体上画一个命令按钮,其名称为Command1,然后编写如下
在数据库中,数据模型包括数据结构、数据操作和
在考生文件夹中有一个工程文件sjt5.vbp。窗体外观如图所示。运行程序,单击“读数据”按钮,读入文件中的数据到字符串变量中并显示在Labe12标签中。单击“排序”命令按钮时,对读入的数据从小到大进行排序,并将排序结果在窗体的Labe14控件中显示。
以下关于事件、事件驱动的叙述中,错误的是( )。
窗体上有一个名称为Text1的文本框,一个名称为Command1的命令按钮。窗体文件的程序如下:PrivateTypexaAsIntegerbAsIntegerEndTypePrivateS
在窗体上画一个命令按钮和一个标签,其名称分别为Command1和Label1,然后编写如下事件过程:PrivateSubCommand1_Click() Dimarr(10) Fori=6To10 arr(i)=i-5 N
下列叙述中正确的是( )。
以下关于数组的叙述中,错误的是
在E-R图中,用来表示实体的图形是
假定在图片框Picturel.中装入了一个图片,在程序运行中,为了清除该图片(注意,清除图片,而不是删除图片框),应采用的正确方法是
随机试题
临床健康咨询的原则不包括
下列关于氢氧化铝的描述正确的是()。
使用特别护理记录单时做法错误的是
社会救济的特征主要体现在:()。
某县“大队长酒楼”自创品牌后声名渐隆,妇孺皆知。同县的“牛记酒楼”经暗访发现,“大队长酒楼”经营特色是,服务员统一着上世纪60年代服装,播放该年代歌曲,店堂装修、菜名等也具有时代印记。“牛记酒楼”遂改名为“老社长酒楼”,服装、歌曲、装修、菜名等一应照搬。根
重型动力触探当连续三次N63.5大于()时,可停止试验。
工程项目应建立以项目经理为组长的安全生产管理机构,工程项目施工实行总承包的,应成立由总承包、专业承包和劳务分包等单位的()等人员组成安全管理领导小组。
以下适用《期货从业人员执业行为准则(修订)》的人员有()。[2012年9月真题]
《中华人民共和国增值税暂行条例》是由()制定的。
根据刑法有关规定,下列有关死缓犯减刑的表述,正确的是()。
最新回复
(
0
)