首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块;并定义了如下类型: 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
63
问题
设在工程中有一个标准模块;并定义了如下类型:
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全国计算机二级
相关试题推荐
为了提高测试的效率,应该
下面叙述中正确的是_______。
下列程序段的执行结果为 Dimt(10) Fork=2To10 t(k)=11-k Nextk X=6 Printt(2+t(x))
有关程序代码窗口的说法错误的是
在待排序的元素序列基本有序的前提下,效率最高的排序方法是
希尔排序法属于哪一种类型的排序法_________。
在下列选项中,哪个不是一个算法一般应该具有的基本特征_________。
具有3个结点的二叉树有
表达式3^2Mod36\2^5的值是【】
设栈S和队列Q的初始状态为空。元素a、b、c、d、e、f依次通过栈S,并且一个元素出栈后即进入队列Q,若出队的顺序为b、d、c、f、e、a,则栈S的容量至少应该为
随机试题
导致“徐发”的因素有
A、Cooperationandconcession.B、Exchangingdailynecessities.C、Equalityandmutualbenefit.D、Introducingadvancedtechnology.
三级耐火等级的多层民用建筑,允许建筑层数最多为()层。
涂饰工程的细部构造—般指( )等。
下列各项中,必须逐日结出余额的账簿有()。
速度、比例和效益的正确关系应该是()。
张某领6岁的儿子到儿童保健门诊述说其儿子最近情绪不好,体重下降,有时腹泻。希望知道孩子究竟得了什么病。医生首先了解其一般情况。询问了膳食情况和其健康状况,并做了相关体格检查后初步判定为轻度蛋白质一能量营养不良。然后建议其进行一系列实验室检测。最后确诊为轻度
下列陈述中错误的是()。
花木兰锦衣卫刘胡兰小花木棉花孔子
在整个上层建筑中,政治上层建筑居主导地位,其核心是()
最新回复
(
0
)