PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Reinitializing positions
  • Various
  • Repositioning principle for Native Accesses
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
HRestorePosition (Function)
In French: HRetourPosition
ODBCNot available with this kind of connection
Restores the file context that was saved beforehand (HSavePosition): current record, filter, pointers.
HRestorePosition is used to restore:
  • the number of the record used,
  • the different pointers in the index (the position in the index is saved for each key),
  • the current filter (only if the hRPFilter constant is specified).
This function can be used with the data files, HFSQL views or queries.
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 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.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
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.
Example
// Find a record
HReadSeekFirst(CUSTOMER, NAME, Name)
WHILE HFound(CUSTOMER) = True
// Saves the current context
nPos = HSavePosition(CUSTOMER, NAME)
// Check a customer with another name
HReadSeek(CUSTOMER, NAME, Name2)
IF HFound() = True THEN Counter = Counter + 1
// Restores the context
HRestorePosition(nPos)
HReadNext(CUSTOMER, LASTNAME)
END
Syntax
<Result> = HRestorePosition(<Position> [, <Option>])
<Result>: Boolean
  • True if the specified position was restored,
  • False otherwise. HError returns more details about the problem.
<Position>: Integer
Position to restore. Value returned by HSavePosition.
<Option>: Optional constant (or combination of constants)
Used to configure the restore operation:
hRPKeepThe position is not freed (other calls to HRestorePosition can be performed on this position).
hRPDefault
(default value)
The position is freed. The stored position is restored.
hRPFilterRestores the filter implemented during the call to HSavePosition.
hRPHF5If the stored position was deleted or modified, this position is still restored.
If the hRPHF5 constant is not specified and if the backup was performed on several items, the positioning is performed according to the current record number during the call to HSavePosition.
PHP This constant is not supported.

Java Access by JDBC: This constant is not supported.
Hyper File 5.5 This parameter is ignored: the position will be stored for all items on which a browse is in progress.
Remarks

Reinitializing positions

Caution: all the functions that open or close a data file reinitialize the context numbers (HCreation, HClose, ...).
If the record saved by HSavePosition was deleted, HRestorePosition keeps the current context but it will position on the record following the deleted record.
OLE DB When reinitializing a browse, the positions saved on this browse are destroyed. The HFSQL engine is using the value of best item to attempt a new positioning. The best item is selected in the following preference order:
  1. Automatic identifier
  2. Unique key
  3. First key
  4. First item
The following functions reinitialize the browse:

Various

  • The number of calls to HSavePosition is not limited.
  • You have the ability to nest HSavePosition and HRestorePosition for the same file.
WINDEVWEBDEV - Server codeNative Accesses

Repositioning principle for Native Accesses

The record is restored from the internal cache of Native Access.
Caution: during the restore operation, no check is performed regarding the existence of record in the database (the record may have been deleted).
You have the ability to "force" the reading on the database by using HRead after HRestorePosition. In this case:
  • the record values will be read again in the database.
  • if the record was deleted, the error 13 will be returned by Native Access: The current record cannot be found. It was modified or deleted from the data source.
Special cases: Native MySQL, DB2 and Informix Accesses: After the call to HRestorePosition, HReadNext and HReadPrevious generate a query to find the record following or preceding the restored record.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment