PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This function is now available for the Windows Phone applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVWEBDEV - Server codeReports and QueriesJavaPHPAjaxUser code (UMC)
// 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
Windows Mobile
// Open an external file
FileID = fOpen("\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.
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.
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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
Java wd230java.jar
Linux wd230std.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment