CFile:FilePos
The FilePos method returns the byte offset of the file read/write pointer.
nPos = CFile:FilePos() |
nPos is the
byte offset of the current file position.
On
success, nPos is a number >= 0.
On
failure, nPos = -1.
The value returned by FilePos is a byte offset from the beginning of the file. If the file is translated to text mode when written to the file, then this value differs from the actual byte offset into the file.
Suppose a CFile F exists and that the file is empty. The following script writes a string to it and then returns the file position after the write operation:
|
-- seek to the beginning of the file |
|
|
|
-- result: pos = 8 |
Mira Pro x64 Script User's Guide, v.8.75 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.