PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Managing errors
  • Current position
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
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.
Reports and Queries
// Open an external file
FileID = fOpen("C:\MyDirectories\File.txt", foReadWrite)
IF FileID <> -1 THEN
...
// Get the current position
ResPosition = fSeek(FileID, 0, fpCurrent)
...
END
Syntax
<Result> = fSeek(<File Identifier> , <Move> , <Source Position>)
<Result>: Integer
  • Current position after modification,
  • -1 if an error occurred. To find out the error details, use ErrorInfo associated with the errMessage constant.
<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.
Remarks

Managing errors

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