首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: 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
64
问题
设在工程中有一个标准模块,并定义了如下类型:
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全国计算机二级
相关试题推荐
下列程序为求Sn=a+aa+aaa+……+aa…a(n个a),其中a为一个随机数产生的1~9(包括1、9)中的一个正整数,n是一个随机数产生的5~10(包括5、10)中的一个正整数,请在空格处填入适当的内容,将程序补充完整。PrivateSub
如下有一段不完整的程序段,如果要求该程序执行3次循环,则在程序中的空白处要填入()。x=1Dox=x+3PrintxLoopUntil______
在Windows95/98下,使用VisualBasic6.0至少需要______的内存。
要想改变一个窗体的标题内容,则应设置______属性的值。
当标签的标题内容太长,需要根据标题自动调整标签的大小时,应设置标签的()属性为True。
下列操作不能向工程中添加宙体的是()。
可以用做其他控件容器的控件是
下列对变量的定义中,不能定义a为变体变量的是
下列叙述中正确的是
表达式(3/2+1)*(5/2+2)的值是
随机试题
教师的专业素养主要包括什么?
需要申请人提出药品补充申请的情况是
下列属于总需求构成的是()。
下列无形资产中属于知识产权的无形资产是()。
关于投资乘数的说法,正确的是()。
2015年1月2日,甲公司取得乙公司30%股权,并与其他投资方共同控制乙公司,甲、乙公司2015年发生的下列交易或事项中会对甲公司2015年个别财务报表中确认的投资收益产生影响的有()。
行政诉讼的审判机关是行政机关。()
背景:()是《人间喜剧》里的一部长篇小说。
It’seasytoimaginethescenario.Afterspendingmostofouradultlifeinpaidemployment,thegoldendayarrives.Suddenlywe
Theyarebothverydeterminedpeople,sothere’srathera______ofpersonalities.
最新回复
(
0
)