首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: 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
68
问题
设在工程中有一个标准模块,并定义了如下类型:
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://www.kaotiyun.com/show/BrHp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
窗体上有一个命令按钮和一个文本框,程序执行后,在文本框中输入12345,单击命令按钮后的输出结果为()。PrivateSubCommandl_Click()DimAAsInteger,BAsIntegerText1.SelS
下面列表框属性中,是数组的是( )。
下列叙述中,不属于软件需求规格说明书的作用的是()。
如果要在窗体上画一个标签,应在工具箱窗口中选择的图标是( )。
设在窗体上有一个名称为Check1的复选框数组,并有以下事件过程:PrivateSubCheck1_Click(IndexAsInteger) …EndSub则下面叙述中错误的是( )。
以下能够触发文本框Change事件的操作是()。
下列可作为VisualBasic变量名的是()。
有下面程序代码:PrivateSubCommand1_Click()a=3s=0Fork=1To5s=s+aModka=a+kNextkPrintsEndSub程序运行后,单击命令按钮Command1,输出结果是(
考生文件夹下存在一个数据库文件“samp3.accdb”,里面已经设计好表对象“tStud”,同时还设计出窗体对象“fStud”和子窗体对象“fDetail”。请在此基础上按照以下要求补充“fStud”窗体的设计。(1)将窗体标题改为“学生查询”
随机试题
下列各项中,属于事业单位资产的是()。
在桶排序中,其平均时间复杂度是()
CT扫描对早期骨肉瘤诊断的价值在于显示
目前临床上见到的疳证多属
A.百合固金丸B.泻心汤C.泻白散D.知柏地黄丸E.龙胆泻肝汤
建井总工期是以下()的工期之和。
我国学生成绩以60分及格为标准,这是评价中的()。
如图所示,扇形纸扇完全打开后,外侧竹条AB、AC夹角为120°,4B的长为30,贴纸部分BD的长为20,则贴纸部分的面积为:
为考生文件夹下的CAO文件夹建立名为CAO2的快捷方式,存放在考生文件夹下的HUE文件夹下。
Thebrainsofchildrenareaffectedbyfamilyviolenceinthesamewayascombataffectssoldiers,accordingtoastudy.Inbot
最新回复
(
0
)