PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Read operation according to a key item or not
  • Memos
  • Lock
  • Various
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
Moves several records forward from the current position in the data file, according to a specified item.
The destination record is read and loaded in memory: the HFSQL variables are updated (Customer.Name for example, which means the Name item of Customer file).
Several cases may occur after the call to HForward:
  • no other record exists in the data file: HOut returns True. No read operation is performed.
  • the function tries to lock a record that is already locked in read-only: HErrorLock returns True and HOut returns True.
    Windows Mobile The management of locks is performed on the HFSQL Client/Server data files and on the data files handled by native access. A HFSQL Mobile record cannot be locked. Indeed, the operating system of Pocket PC does not allow you to lock records.
    PHP The management of locks is not available in PHP.
    Java Access by JDBC: The management of locks is not available for the databases accessed by JDBC.
    Android The management of locks is not available for the SQLite databases.
This function can be used with the HFSQL files, 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.
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.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
// Moves to the 2000th record
// of CUSTOMER file according to CUSTNAME key
HReadFirst(CUSTOMER, CUSTNAME)
HForward(CUSTOMER, CUSTNAME, 1999)
WINDEVWEBDEV - Server codeReports and QueriesWindows MobileJavaUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Accesses
// Check the status report of HForward
// Moves to the 2000th record
// of CUSTOMER file according to CUSTNAME key
HReadFirst(CUSTOMER, CUSTNAME)
IF HForward(CUSTOMER, CUSTNAME, 1999, hLockWrite) = False THEN
IF HErrorLock() = True THEN
Info("This record is currently used")
ELSE
Error(HErrorInfo())
END
END
Syntax
<Result> = HForward([<File Name> [, <Item Name>] [, <Step> [, <Options>]]])
<Result>: Boolean
  • True if the move was performed in the file,
  • False if an error occurred (lock, end of file, etc.): the record is not read. HError is used to identify the error.
<File Name>: Optional character string (with or without quotes)
Name of data file, view or query used. If this name is not specified, HForward handles the last data file used by the last function for HFSQL management (starting with the letter H).
PHP This parameter corresponds to a file name.
<Item Name>: Optional character string (with or without quotes)
Name of item according to which the browse is performed. If this name is not specified, HForward handles the last file item used by the last function for HFSQL management (starting with the letter H).
<Step>: Optional integer
Number of steps forward (which means number of records to browse). By default, <Step> = 1.
PHP <Step> is mandatory if <Item Name> was specified.
<Options>: Optional Integer constant (or combination of constants)
Configures:
  • the lock mode applied to the record read. By default, the lock performed corresponds to the current lock.
    hLockNoNo lock (even if HStartLock was called): the record can be read or modified by another application during the reading.
    hLockWriteLock in write mode: the record currently read can be read by another application but it cannot be modified by another application.
    hLockReadWriteLock in read/write: the record currently read cannot be read or modified by another application.
Windows Mobile The management of locks is performed on the HFSQL Client/Server data files and on the data files handled by native access. A HFSQL Mobile record cannot be locked. Indeed, the operating system of Pocket PC does not allow you to lock records.
OLE DBNative Accesses The lock options will have no effect if the locks are not supported by the OLE DB provider or by Native Access.
Java Access by JDBC: The management of locks is not available for the databases accessed by JDBC.
AndroidAndroid Widget The management of locks is not available for the SQLite databases.
  • the management of duplicates during the browse. By default, all the duplicates are browsed.
    hDistinctWhen a browse is performed on a key item, a single record is browsed if duplicates are found.
Hyper File 5.5 <Options> is ignored.
PHP <Options> is ignored.
Remarks

Read operation according to a key item or not

In all cases, the browse operation must have been initialized by one of the following functions: HReadFirst, HFirst, HReadSeekFirst, HSeekFirst, HChangeKey, HRestorePosition.
If the item used is a key item:
  • if the hDistinct constant is not specified, HForward moves forward from <Step> key values from the current position.
  • if the hDistinct constant is specified, HForward moves forward from <Step> distinct key values from the current position. If duplicates are found, a single duplicate is read.
If the item used is not a key item:
  • the hDistinct constant is not available.
  • HForward moves foward from <Step> active records from the current position.

Memos

The memos associated with the record can be automatically read (or not) when reading the record. HSetMemo is used to customize this automatic read operation.
If the memos are supported, the associated text memos are read when the record is read. The binary memos are read only when they are explicitly used (HExtractMemo).
WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadWindows MobileUniversal Windows 10 AppJavaAjaxUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Accesses

Lock

By default (no lock variable specified), the lock performed corresponds to the current lock mode.
If a lock is specified (hLockWrite or hLockReadWrite constant), the record will be read and locked only if it is not already locked by another application.
There is no need to specify a lock constant if the file is locked by HStartLock: the lock specified by HStartLock is automatically taken into account. To ignore the lock specified by HStartLock, use the hLockNo constant.
OLE DBNative Accesses The lock options will have no effect if the locks are not supported by the OLE DB provider or by Native Access.

Various

  • The result of HFound must be ignored (HFound must be used for the searches performed by HReadSeek).
  • The current record number is returned by HRecNum.
  • HForward respects the current active filter (defined by HFilter).
  • HChangeKey is used to modify the search key while being positioned on the current record.
  • HForward(Customer,Name) is equivalent to HReadNext(Customer,Name)
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