SeekFile
Usage:
SeekFile(Handle, Offset)
Description:
The SeekFile command changes the current file position for read/write operations. The current position can be retrieved using the FilePos command.
The Handle parameter is the file handle returned by ReadFile, WriteFile or OpenFile. The Offset parameter is the new position in bytes, starting from 0.
Example:
Function Main()
F = OpenFile("Test.txt")
// Read in current first line and display to user
FileData = ReadLine(F)
Output(Actor(), FileData)
// Return to the beginning of the file and write a new line
SeekFile(F, 0)
WriteLine(F, "This text will be readable in Notepad")
CloseFile(F)
Return()
End Function
Comments (0)
You don't have permission to comment on this page.