Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Managing errors
  • Current position
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
fSeek (Function)
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).
Using the read functions (fRead, fReadLine) and the write functions (fWrite, fWriteLine) modifies the current position.
WEBDEV - Server codePHPAjax
// Ouverture d'un fichier externe
IDFichier = fOpen("C:\MesRépertoires\Fichier.txt", foReadWrite)
IF IDFichier <> -1 THEN
// Récupération de la position en cours
ResPosition = fSeek(IDFichier, 0, fpCurrent)
<Result> = fSeek(<File identifier> , <Move> , <Source Position>)
<Result>: Integer
  • Current position after modification,
  • -1 if an error occurred. To find out the name of the error, use the function ErrorInfo with the constant errMessage.
PHP This parameter must be a variant.
<File identifier>: Integer
Identifier of file to use, defined by fOpen or fCreate.
<Move>: Integer
Number of bytes (characters) corresponding to the requested move in the file. When the move is performed from the end of the file (fpEnd constant), this number must be negative.
<Source Position>: Constant
Specifies the source position:
fpCurrentThe source position corresponds to the current position.
fpBeginningThe source position corresponds to the first file byte (position 0).
fpEndThe source position corresponds to the last file byte.

Managing errors

The function fSeek generates 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:
PositionEnCours = fSeek(IDFichier, 0, fpCurrent)
No move is performed in the specified file.
Component: wd260std.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment