首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: 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
59
问题
设在工程中有一个标准模块,并定义了如下类型:
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://kaotiyun.com/show/DwLp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
设a=5,b=6,c=7,d=8,执行下列语句后,x的值为()。x=IIf((a>b)And(c>d),10,20)
要强制显示声明变量,可在窗体模块或标准模块的声明段中加入语句()。
以下关于过程的叙述中,错误的是()。
英文缩写“OOP’’的含义是()。
下列操作不能向工程中添加宙体的是()。
下列程序段的执行结果为a=6Fork=1T00a=a+kNextPrintk;a
设A$="北京",B$="Shanghai",则表达式LEFTS(A$,2)+STRINGS(3,"-")+LEFTS(B$,8)构成的字符串是
一个工程中含有窗体Form1、Form2和标准模块Model1,如果在Form1中有语句PublicXAsInteger,在Model1中有语句PublicYAsInteger。则以下叙述中正确的是
在3种不同类型的组合框中,只能选择而不能输入数据的组合框是¬¬¬______。
以下关于顺序文件的叙述中,正确的是
随机试题
Someproblemscanbereadilyidentifiedsimplybylookingaround.Theseproblemsconcernthepollutionofourenvironmentbytec
6岁男童,10天前有咽扁桃体炎,2日前出现眼睑水肿,以急性肾小球肾炎收入院,目前使用青霉素治疗,其目的是
狗脊的人药部位是
甲公司在城乡结合部有一宗面积为5000m2的综合用地,地上有三幢房屋,临路为店面,院内有一处仓库和一处住宅用房,基本情况见下表:如果对上述房地产进行估价,当利用成本法测算土地价格时,不应计入土地取得相关税费的是()。
下列函数中不是方程y’’-2y’+y=0的解的函数是()。
四川新五大旅游区中的“两湖一山”指的是()。
填入下列横线处的词语,最恰当的一组是( )。①月亮每月绕地球一周,______每月有一次朔和望。②花园里种着牡丹、月季、夹竹桃______其他的花木。③人民所厌恶的国家分裂和混乱的局面,______一去不复返了。
下列选项中,不属于种群自动调节机制的是______。
已知m个向量α1,…,αm线性相关,但其中任意m—1个向量都线性无关,证明:如果等式k1α1+…+kmαm=0和等式l1α1+…+lmαm=0都成立,则,其中l1≠0。
KidsoftenaskScoutBassett,ofPalmDesert,California,ifshewishesshehadtwonormallegs.Scout,18,answers,"No.Ihave
最新回复
(
0
)