- Handling errors
- Current position
In french: fPositionne
Returns and modifies the current position in an external file.
When opening a file, the current position corresponds to:
- the first file byte,
- the last file byte if the file is opened in "addition" mode (foAdd constant).
New in version 28
<Result> = fSeek(<File used> , <Move> , <Source position>)
- Current position after modification,
- -1 if an error occurred. To get more details on the error, use ErrorInfo with the errMessage constant.
This parameter must be a variant.
<File used>: Integer or DiskFile variable
Amount of bytes (characters) to offset in the file. To move backwards from the end of the file (fpEnd constant), this number must be negative.
<Source position>: Constant
Specifies the source position:
|fpBeginning||The source position corresponds to the first file byte (position 0). |
|fpCurrent||The source position corresponds to the current position.|
|fpEnd||The source position corresponds to the last file byte.|
fSeek throws an error in the following cases:
- the file is not opened,
- the file is locked by another computer or by another application.
To retrieve the current position in the external file, use the following syntax:
CurrentPosition = fSeek(FileID, 0, fpCurrent)
No move is performed in the specified file.
Business / UI classification: Business Logic
This page is also available for…