首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块;并定义了如下类型: Type Stutype ino As Integer strname AS String*20 strsex As String*2 s
设在工程中有一个标准模块;并定义了如下类型: Type Stutype ino As Integer strname AS String*20 strsex As String*2 s
admin
2012-09-07
40
问题
设在工程中有一个标准模块;并定义了如下类型:
Type Stutype
ino As Integer
strname AS String*20
strsex As String*2
smark As 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:.strname=“smith”:
.strsex=“男”:.smark=89
End With
Open“c:\Student.dat”For Input As#1 Len=Len(Student)
Put#1.record_no.Student
Close#1
End Sub
B、Sub Commandl_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 Random As#1 Len=Len(Student)
Put#1.Record_no.Student
Close#1
End Sub
C、Private Sub Commandl_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
EndSub
D、Sub Commandl_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 FileNameFor Random As#文件号[Len=记录长度],然后以Put方法写入一条记录,方法的格式为:Put[#]文件号,[记录号],变量名。
转载请注明原文地址:https://kaotiyun.com/show/aPhp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
以下程序段的输出结果是【】。num=0DoWhilenum<=5num=num+1LoopPrintnum
下列程序段的执行结果为_______。N=0ForI=1To3ForJ=5To1Step-1N=N+1NextJNextIPrintN;J;I
为了避免流程图在描述程序逻辑时的灵活性,提出了用方框图来代替传统的程序流程图,通常也把这种图称为_________。
单击命令按钮时,下列程序的执行结果为 PrivateSubCommand1Click() DimxAsInteger,yAsInteger x=12:y=32 CallPCS(x,y) Printx;y
下列叙述中,不属于结构化分析方法的是
Jackson结构化程序设计方法是英国的M.Jackson提出的,它是一种面向【】的设计方法。
按条件f对关系R进行选择,其关系代数表达式为_________。
将数学表达式Cos2(a+b)+5e2写成VisualBasic的表达式,其正确的形式是
某二叉树中度为2的结点有18个,则该二叉树中有【】个叶子结点。
下列关于队列的叙述正确的是
随机试题
下列有关行政指导说法正确的有()。
H市I化工厂,占地面积为12.9公顷,企业有员工140人,主要为周边村庄百姓。2016年8月14日9时,磺化车间一班次操作工王某和李某按照投料比例加入氯磺酸至反应釜中,加入催化剂和滴加硝基苯后,由于蒸汽压力不够,当班没有进行升温操作;下一班次同样没有进行升
当获证企业发生质量体系严重不符合规定的情况时,认证机构可以作出认证()的决定,企业不服可提出申诉。
()是指监管部门对银行市场运行状况进行系统、及时地信息收集和信息处理,以维护市场秩序和防范市场风险。
下列价值工程活动中,属于价值工程核心的是()。
甲公司与股权投资的相关资料如下:(1)甲公司原持有乙公司30%的股权,并能够对乙公司施加重大影响。2019年月1日,甲公司支付银行存款13000万元,进一步取得乙公司50%的股权,并能够控制乙公司的财务经营决策。原投资账面价值为5400万元(包括:投资成
旅游的灵魂是()。
设f(x)=,求df(x)|x=1.
EmerginginthelateSixtiesandreachingapeakintheSeventies,LandArtwasoneofarangeofnewforms,includingBodyArt,
(1)TheBoyScoutsofAmerica(BSA),thelargestyouthorganizationintheUnitedStates,haspolicieswhichprohibitatheists,ag
最新回复
(
0
)