7,763
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Private Sub Command1_Click()
Dim f As Integer
Dim i As Long
Dim d As Double
Dim pos As Long
f = FreeFile()
Open "c:\data.bin" For Binary Access Write As #f
For i = 0 To 99
d = i / 100#
Put #f, , d
Next
Close #f
Open "c:\data.bin" For Binary Access Read As #f
Debug.Print "LOC(f)="; Loc(f)
Get #f, , d
Debug.Print Format(d, "0.00")
Debug.Print "LOC(f)="; Loc(f)
Get #f, , d
Debug.Print Format(d, "0.00")
Debug.Print "LOC(f)="; Loc(f)
Seek #f, 1& + 12 * 8& '读第12个Double数
Debug.Print "LOC(f)="; Loc(f)
Get #f, , d
Debug.Print Format(d, "0.00")
Debug.Print "LOC(f)="; Loc(f)
Close #f
End Sub