SEEK(filenumber)

Returns the current read/write position within a file opened using the Open statement (Long).


filenumberThe number of the file (Integer).

REMARKS
* This function returns the position based on a file opened with the Open subroutine.
* The value returned is between 1 and 2,147,483,647.
* If the file access mode is Random, then the number returned is the next record read or written.
* If the file access mode is Binary, Output, Append or Input, then the byte position at which the next operation takes place is returned.
* The equivalent .NET function is Microsoft.VisualBasic.FileSystem.Seek
* For the Microsoft documentation refer to docs.microsoft.com

Type Record 
   ID As Integer
   Name As String
End Type

Dim myRecord As Record
Open "MyFile" For Random As #1 Len=Len(MyRecord)
Do While Not Eof(1)
   Get #1, 1, myRecord
   Debug.Print Seek(1)
Loop
Close #1

Dim myChar
Open "MyFile" For Input As #1
Do While Not Eof(1)
   myChar = Input(1, #1)
   Debug.Print Seek(1)
Loop
Close #1

© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited Top