| Mode | Return Value | |
| Random | Number of the next record read or written. | |
| Binary, Output, Append, Input | Byte position at which the next operation takes place. The first byte in a file is at position 1, the second byte is at position 2, and so on. | |
Type Record                                ' Define user-defined type.
    ID As Integer
    Name As String * 20
End TypeDim MyRecord As Record                ' Declare variable.
Open "TESTFILE" For Random As #1 Len = Len(MyRecord)
Do While Not EOF(1)                    ' Loop until end of file.
    Get #1, , MyRecord                    ' Read next record.
    Debug.Print Seek(1)                ' Print record number to Debug 
                                            ' window.
Loop
Close #1                                    ' Close file.Dim MyChar
Open "TESTFILE" For Input As #1    ' Open file for reading.
Do While Not EOF(1)                    ' Loop until end of file.
    MyChar = Input(1, #1)                ' Read next character of data.
    Debug.Print Seek(1)                ' Print byte position to Debug
                                            ' window.
Loop
Close #1                                    ' Close file.