|
|
|
|
- Handling errors
- Current position
<DiskFile variable>.Seek (Function) In french: <Variable FichierDisque>.Positionne Gets and sets 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).
Syntax
<Result> = <File used>.SetPosition(<Move> , <Source position>)
<Result>: Integer - Current position after modification,
- -1 if an error occurred. To get more details on the error, use ErrorInfo with the errMessage constant.
<File used>: DiskFile variable Name of the DiskFile variable initialized with .Open or Create. <Move>: Integer 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. |
Remarks Handling errors <DiskFile variable>.Seek throws an error in the following cases: - the file is not opened,
- the file is locked by another computer or by another application.
Current position To retrieve the current position in the external file, use the following syntax:
NomFichier is DiskFile
...
PositionEnCours = NomFichier.Positionne(0, fpCurrent)
No move is performed in the specified file. Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|