Home | Sign in | English EN

This content has been translated automatically. Click here to view the French version.
  • Read operation according to a key item or not
  • Memos
  • Various
  • Lock
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
Moves backward several records 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 HBackward:
  • no other record exists in the data file: function 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.

    PHP Management of locks not available in PHP.
    Java Access by JDBC: The management of locks is not available for databases accessed by JDBC.
This function can be used with the data files, HFSQL views or queries.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
// Go back to the 200th record of the Customer data file
// according to the CustName key
HReadLast(Customer, CustName)
HBackward(Customer, CustName, 199)
<Result> = HBackward([<Data file> [, <Item>] [, <Step> [, <Options>]]])
<Result>: Boolean
  • True if the backward move was performed in the data file,
  • False if an error occurred (lock, end of file, etc.): the record is not read. HError is used to identify the error.
<Data file>: Optional character string (with or without quotes)
Name of data file, view or query used. If this name is not specified, HBackward will use the last data file used by the last HFSQL management function (function starting with "H").
<Item>: Optional character string (with or without quotes)
Name of item according to which the browse is performed. If this name is not specified, HBackward handles the last file item used by the last function for HFSQL management (starting with the letter H).
OLE DBNative Connectors (Native Accesses) All the items used to move backward in the file are considered as being key items.
PHP The <Step> parameter is mandatory if this parameter is not specified.
<Step>: Optional integer
Number of steps backward (which means number of records to browse). By default, <Step> = 1.
<Options>: Optional Integer constant (or combination of constants)
  • 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.

    OLE DBNative Connectors (Native Accesses) The lock options will have no effect if the locks are not supported by the OLE DB provider or by the Native Connector.
  • 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.
Java Access by JDBC: <Options> is ignored.

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 enabled, HBackward moves backward of <Step> key values from the current position.
  • if the hDistinct constant is enabled, HBackward moves backward of <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,
  • HBackward moves backward of <Step> active records from the current position.


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).


Reports and QueriesJavaUser code (UMC)External languageAjaxHFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses)


By default (no lock variable specified), the lock performed corresponds to the current lock mode.
If a lock is requested (hLockWrite or hLockReadWrite constant), the record will be read and locked only if this record is not already locked by another application.
There is no need to specify a lock parameter if the data file is locked by HStartLock: the lock specified by HStartLock is automatically taken into account. To ignore the lock set by HStartLock, use the hLockNo constant.
Component: wd260hf.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment