首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer strname As String*20 strsex AS String*2 smark As Single
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer strname As String*20 strsex AS String*2 smark As Single
admin
2016-01-22
58
问题
设在工程中有一个标准模块,并定义了如下类型:
Type Stutype
ino As Integer
strname As String*20
strsex AS String*2
smark As Single
EndType
在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1 Click时,在C盘根目录下的随机文件Student.dat中写入一条记录。下列能够完成该操作的是( )。
选项
A、Sub Command1_Click()
Dim student As Studype
Dim record_no As Integer
record_no=1
With student
.ino=12:.stmame="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:.stmame="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 Command1 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,R
D、Sub Command1_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 Output As#1 Len=Len(Student)
Put#1,Record_no,S
答案
B
解析
本题考查文件操作。题目中要求以随机的方式(Random)打开一个文件,打开文件的方法格式为:Open FileName For Random As #文件号[Len=记录长度],然后以Put方法写入一条记录,方法的格式为:Put[#]文件号,[记录号],变量名。
转载请注明原文地址:https://www.kaotiyun.com/show/DwLp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
要强制显示声明变量,可在窗体模块或标准模块的声明段中加入语句()。
如果一个变量未经定义就直接使用,则该变量的类型为()。
只有将组合框的Style属性设置为()值时,才能触发DblClick事件。
下列操作不能向工程中添加宙体的是()。
有下列函数过程:FunctionFunc2(aAsInteger,bAsInteger)AsIntegerStaticmAsInteger,iAsIntegerm=0i=2a=i+m+1b=i+a+bFunc2=mEnd
下面程序运行后,输出的结果是Dimarr(3,3)Forj=1To3Fork=1To3Art(j,k)=(j-1)*3+kNextkNextjForj=2To3Fork=2To3Printarr(k,j);
设用复制、粘贴的方法建立了一个命令按钮数组Command1,以下对该数组的说法错误的是
在3种不同类型的组合框中,只能选择而不能输入数据的组合框是______。
模拟方形骰子投掷的表达式是()。
随机试题
麝香的功效不包括
急性粒一单细胞性白血病(M4)下列哪项不正确
关于基准平面,下列说法不正确的是
下列行为构成诈骗罪的有:()
生活垃圾填埋场场址的选择应避开下列()区域。
根据国际设施管理协会的设施管理定义,下列管理事项中,属于物业运行管理的是()。
由于记账符号,账户分类,记账规则和试算平衡方法的不同,复式记账法分为()。
下列关于商业银行从事项目融资业务,说法正确的有()。
2014年上半年,上海市建筑企业直接同建设单位签订合同额11310.77亿元,其中本年新签合同额3934.43亿元,比去年同期增长25.6%。全市特级和一级资质建筑企业本年新签合同额1849.7亿元和1495.42亿元,分别增长39.7%和20.4%;而二
设总体X的概率密度f(x)=(一∞<x<+∞),其中μ为未知参数.若总体X有以下样本值:1000,1100,则μ的最大似然估计值唯一吗?
最新回复
(
0
)