栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验

[单项选择题] 设在工程中有一个标准模块,其中定义了如下记录类型:TyPe Record ID A3 IntegerName As String*20 End TyPe 在窗体中添加一个名为Com

面试经验 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

[单项选择题] 设在工程中有一个标准模块,其中定义了如下记录类型:TyPe Record ID A3 IntegerName As String*20  End TyPe  在窗体中添加一个名为Com

[单项选择题] 设在工程中有一个标准模块,其中定义了如下记录类型:TyPe Record ID A3 IntegerName As String*20 End TyPe 在窗体中添加一个名为Command1的命令按钮,假设d:F1.dat文件中含有5个用户自定义类型的记录。要求当执行事件过程Command1_Click时,随机访问该文件,并把文件中的第4条记录读出。下列能够完成该操作的程序段是


A.Private Sub Command1_Click( ) Dim MyRecord As Record,PositionOpen"d:F1.dat"For Random As#1 Len=Len(My RecorPosition=4 Get#1,Position,MyrecordClose #1End Sub
B.Private Sub Command1_Click( )Dim MyRecord As Record,Position Open"d:F1.dat"For Random As #1 Len=Len(MyRecorPosition=4Put #1,Position,MyRecordClose#1 End Sub
C.Private Sub Command1_Click( )Dim MyRecord As Record,PositionOpen"d:F1.dar"For OutPut As #1 Len=Len(My RecorPosition=4Get #1,Position,MyRecordClose#1 End Sub
D.Private Sub Command1_Click( )Dim MyRecord As record,PositionOpen"d:F1.dat"For lnput As #1 Len=Len(MyRecorPosition=4Get #1,Position,MyRecordClose#1End Sub


参考答案:

A

问题解析:

由于是以随机方式访问该文件,故打开方式为Random。选项C以Output方式打开,选项D以Input方式打开都是错误的。同时由于要读出第四条记录,故使用Get#语句。
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/258096.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号