首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块;并定义了如下类型: 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
67
问题
设在工程中有一个标准模块;并定义了如下类型:
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全国计算机二级
相关试题推荐
下列表达式有错误,正确的写法应该是【】。[(a+B)+c]/80-5÷(d+e)
为了使图片框的大小可以自动适应图片的尺寸,则应_______。
线性表的顺序存储结构和线性表的链式存储结构分别是
设置复选框中或单选按钮的标题对齐方式的属性是_______。
以下叙述中错误的是_______。
Jackson结构化程序设计方法是英国的M.Jackson提出的,它是一种面向【】的设计方法。
将代数式转换成程序设计中的表达式为【】。
数据流图的类型有【】和事务型。
假设A="GoodMorning.",B="Afternoon,Boys.",则下列表达式的结果等于"GoodBoys."的是()。
下列软件系统结构图的宽度为【】。
随机试题
Whatisthemaintopicofthepassage?IcecrystalsdoNOTimmediatelyfalltoEarthbecause______.
Arecentdevelopmentisthelocalareanetwork(LAN).【21】itsnameimplies,itservesalocalarea-possiblyassmallasasingle
关于胆管结石的CT表现,下面哪种说法是错误的
下列关于激素的叙述,不正确的是()。
在地震区采用钢框简结构时,下列所述的哪一项内容是合理的?[2003年第131题]Ⅰ.当采用矩形平面时,其长宽比不宜大于2Ⅱ.外筒承担全部地震作用,内部结构仅承担竖向荷载Ⅲ.是由周边稀柱框架与核心筒组成的结构Ⅲ.在地震区,根据规范,其适用的最大高度与
对于必须进入冬季、雨季施工的工程,应落实季节性施工措施,以增加全年的施工日数,提高施工的连续性和( )性。
由于通信项目分布式覆盖的特点,导致()。
国家开发银行的贷款分为()。
材料1十年来,我们取得一系列新的历史性成就,为全面建成小康社会打下了坚实基础。我国经济总量从世界第六位跃升到第二位,社会生产力、经济实力、科技实力迈上一个大台阶,人民生活水平、居民收入水平、社会保障水平迈上一个大台阶,综合国力、国际竞争力、团际影响力迈上
Britainwaswealthycountry,ahundredandfiftyyears【C1】______Therewerea【C2】______veryrichpeople【C3】______receivedmon
最新回复
(
0
)