[单选题]

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

A.Private Sub Command1_Click( ) Dim MyRecord As Record,Position Open"d:/F1.dat"For Random As#1 Len=Len(My RecorD)Position=4 Get#1,Position,Myrecord Close #1 End Sub

B.Private Sub Command1_Click( ) Dim MyRecord As Record,Position Open"d:/F1.dat"For Random As #1 Len=Len(MyRecorD)Position=4 Put #1,Position,MyRecord Close#1 End Sub

C.Private Sub Command1_Click( ) Dim MyRecord As Record,Position Open"d:/F1.dar"For OutPut As #1 Len=Len(My RecorD0Position=4 Get #1,Position,MyRecord Close#1 End Sub

D.Private Sub Command1_Click( ) Dim MyRecord As record,Position Open"d:/F1.dat"For lnput As #1 Len=Len(MyRecorD)Position=4 Get #1,Position,MyRecord Close#1 End Sub

参考答案与解析:

相关试题

设在工程中有一个标准模块,其中定义了如下记录类型: TyPe Record ID