// 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: | |
hRPKeep | The 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. |
hRPFilter | Restores the filter implemented during the call to HSavePosition. |
hRPHF5 | If 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.
|
Remarks
Caution: all the functions that open or close a data file reinitialize the context numbers (
HCreation,
HClose, etc.).
If the record saved by
HSavePosition was deleted,
HRestorePosition keeps the current context but it will position on the record following the deleted record.
- The number of calls to HSavePosition is not limited.
- You have the ability to nest HSavePosition and HRestorePosition for the same file.
Business / GUI classification : Business Logic