首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmameAs String*20 strsexAs String*2 smark As Single
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmameAs String*20 strsexAs String*2 smark As Single
admin
2016-03-21
54
问题
设在工程中有一个标准模块,并定义了如下类型:
Type Stutype
ino As Integer
stmameAs String*20
strsexAs String*2
smark As Single
EndType
在窗体上画一个名为Commandl的命令按钮,要求当执行事件过程Commandl Click时,在C盘根目录下的随机文件Student.dat中写入一条记录。下列能够完成该操作的是( )。
选项
A、Sub Command 1_Click()
Dim student As Studtype
Dim record_no As Integer
record no=l
With student
ino=12:strname=“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 Command 1 Click()
Dim Student As Stutype
Dim Record no As Integer
Record no=1
With Student
.ino=12:.strname=“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 Commandt Click()
Dim StudentAs 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
D、Sub Commandl—Click()
Dim Student As Stutype
Dim Record——no As Integer
Record—no=1
With Student
.ino=12:.strname=“smith”
.strsex=“男”:.smark=89
EndWith
Open“c:\student.dat”For Output As#1 Len=
Len(Student)
Put#1,Recor
答案
B
解析
本题考查文件操作。题目中要求以随机的方式(Random)打开一个文件,打开文件的方法格式为:0pen File NameForRandomAs#文件号[Len=记录长度],然后以Put方法写入一条记录,方法的格式为:Put[#]文件号,[记录号],变量名。
转载请注明原文地址:https://kaotiyun.com/show/egLp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
下列程序段的输出结果是()。A=0PrintA+1A=3
按照“先进后出”原则组织数据的数据结构是()。
在命令按钮上释放鼠标按钮时,所触发的事件称为______。
以下关于函数过程的叙述中,正确的是()。
有如下SUB过程:Subs(xAsSingle,yAsSingle)t=xx=t/yy=tModyEndSub在窗体上添加一个命令按钮,然后编写如下事件过程:PrivateSubF
软件工程研究的内容主要包括:【】技术和软件工程管理。
在窗体上画一个命令按钮,然后编写如下事件过程:PrivateSubCommand1_Click()Fori=1To4x=4Forj=1To2x=x+6NextNextPrintxEndSub程序运
在窗体上有一个命令按钮,然后编写如下事件过程。PrivateSubCommand1_Click()Dima(5)AsStringFORi=1To5a(i)=Chr(Asc("A")+(i-1))
如果要将窗体中的某个命令按钮设置成无效状态,应该设置命令按钮的什么属性
设a=5,b=4,c=3,d=2,则表达式3>2术bOra=cAndb<>cOrc>d的值是
随机试题
在加强卫生系统社会主义精神文明建设中,应当提高医务人员的( )
女婴,10个月。体重10kg,头围45cm,方颅,前囟1.5cm×1.0cm,平坦,今晨突然抽搐1次,持续1~2min缓解。当时测体温37.5℃,抽搐后即入睡。醒后活动如常。查血钙1.75mmol/L(7mg/dl),血磷45mmol/L(4.5mg/d
简述糖皮质激素的主要药理作用。
建设方案研究是指对项目各种建设方案进行分析研究、比选和优化,拟采用最佳方案的全过程,是进行项目()的基础。
起草培训制度草案,一般应包括()。
(国家2011—77)同时打开游泳池的A、B两个进水管,加满水需1小时30分钟,且A管比B管多进水180立方米。若单独打开A管,加满水需2小时40分钟。则B管每分钟进水多少立方米?()
Childrenmodelthemselveslargelyontheirparents.Theydosomainlythroughidentification.Childrenidentify【C1】______apar
Whetherwewantitornotweareallgreedybynature.Fromthemomentweare【C1】______andtothelastdayofourlifewe【C2】___
すみません。あしたはちょっと()が悪くて。
ShoppinghabitsintheUnitedStateshavechangedgreatlyinthelastquarterofthe20thcentury.【C1】______inthe1900smos
最新回复
(
0
)