首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: 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
60
问题
设在工程中有一个标准模块,并定义了如下类型:
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全国计算机二级
相关试题推荐
在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序:FunctionFunc(ByValxAsInteger,YAsInteger)y=x*yIfy>0Then
下面叙述中正确的是______。
软件设计包括软件的结构、数据接口和过程设计,其中软件的过程设计是指______。
设有如下程序段:a$="BeujingShanghai"b$=Mid(a$,Instr(a$,"g")+1)。执行上面的程序段后,变量b$的值为______。
在窗体上画四个文本框(如下图所示),并用这四个文本框建立一个控件数组,名称为Text1(下标从0开始,自左至右顺序增大),然后编写如下事件过程PrivateSubCommandl_Click()ForEachTextBoxin
决定一个窗体有无控制菜单的属性是()。
在窗体上画一个命令按钮,然后编写如下事件过程:PrivateSubCommand1_Click()Fori=1To4x=4Forj=1To2x=x+6NextNextPrintxEndSub程序运
在数据库设计中,将E-R图转换成关系数据模型的过程属于
开发软件时对提高开发人员工作效率至关重要的是
随机试题
下列哪项不是血清阴性脊柱关节病的特点
对白日咳嗽为主者宜选用()。
根据《招标投标法实施条例》,关于对招标人处罚的说法正确的有()。
期量标准是对生产作业计划中的()经过分析和计算而规定的标准数据。
根据《公民道德建设实施纲要》的规定,下列说法中正确的()。
中国2011西安世界园艺博览会(Expo2011XI’ANCHINA),是第41届世界园艺博览会。该博览会是由陕西省政府、西安市政府共同主办的。()
Culturalglobalization,formany,meansWesternizationorAmericanization.Animportantdistinctionconcerningtoday’scultural
InChinacalligraphyoccupiesadistinguishedpositioninthefieldoftraditionalart.Itisnotonlyameansofcommunication
Thefollowingisaletter.Afterreadingit,youshouldcompletetheinformationbyfillingintheblanksmarked46through50i
A、Collectinginformationabouttheproject.B、Workingonacattleranch.C、Writingapaperaboutextinctanimals.D、Analyzingbu
最新回复
(
0
)