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

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

[单项选择题] 设在工程中有一个标准模块,其中定义了如下记录类型: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#语句。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5591835.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-14

发表评论

登录后才能评论

评论列表(0条)

保存