PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Example for managing the positions in a data file
  • Reinitializing positions
  • Various
  • Repositioning by OLE DB and Native MySQL, DB2 and Informix Access
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
HSavePosition (Function)
In French: HSauvePosition
ODBCNot available with this kind of connection
Stores the current context of a data file: current record, filter, pointers. This allows you to temporarily suspend the current process in order for the data file to be used somewhere else (to perform checks for example). The context saved can be restored by HRestorePosition. Then, the main process can continue.
HSavePosition is used to save:
  • 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. You will have to use the hRPFilter constant in HRestorePosition to restore the stored filter.
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> = HSavePosition([<File Name> [, <Item Name>]] [, <Options>])
<Result>: Integer
  • Number of the position that was saved,
  • -1 if an error occurred.
<File Name>: Optional character string (with or without quotes)
Name of data file, view or query used. If this name is not specified, HSavePosition handles the last data file used by the last function for HFSQL management (starting with the letter H).
<Item Name>: Optional character string (with or without quotes)
Name of item used. If this parameter is not specified, HSavePosition saves the positions of all items for which a browse is in progress.
Hyper File 5.5 The <Item Name> parameter will be ignored: the position will be stored for all items on which a browse is in progress.
<Options>: Optional integer constant
Used to configure the backup:
hSaveItemsSaves the values of items in memory when using HSavePosition. These values will be restored during the call to HRestorePosition.
AndroidAndroid Widget Java This parameter is not supported.
Remarks

Example for managing the positions in a data file

HSavePosition and HRestorePosition can be used in the following cases for example:
  • browsing a data file according to a key (form by form), calling another window in order to view in a table. The management of positions allows you to easily go back to the proper record in the form-by-form browse.
  • viewing a file in a table, selecting a record for a form-by-form access. The management of positions allows you to go back to the display of table while being properly positioned in the data file.

Reinitializing positions

Caution: all the functions that open or close a data file reinitialize the context numbers (HCreation, HClose, ...).

Various

  • The number of calls to HSavePosition is not limited.
  • You have the ability to nest HSavePosition and HRestorePosition for the same data file.
  • If the record pointed during the call to HSavePosition is deleted, HRestorePosition cannot be called anymore.
WINDEVWEBDEV - Server codePHPOLE DBNative Accesses

Repositioning by OLE DB and Native MySQL, DB2 and Informix Access

If the database or the status of browse (re-initialized browse for example) does not allow you to directly reposition on the record, the positioning is performed in the cache of records read.
The following functions reinitialize the browse:
This operating mode is the same in Java.
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