PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • 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: HFSQL variables are updated (e.g. Customer.Name, i.e. item Name of data file Customer).
Several cases may occur after the call to <Source>.Forward:
  • no other record exists in the data file: function <Source>.Out 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 <Source>.Out 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 HFSQL files, views or queries. Remark: From version 19, HFSQL is the new name of HyperFileSQL.
Example
// Moves to the 2000th record
// of the Customer file according to the CustName key
Customer.ReadFirst(CustName)
Customer.Forward(CustName, 1999)
Reports and QueriesJavaUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses)
// Test of the <Source>.Forward status report
// Moves to the 2000th record
// of the Customer file according to the CustName key
Customer.ReadFirst(CustName)
IF Customer.Forward(CustName, 1999, hLockWrite) = False THEN
IF HErrorLock() = True THEN
Info("This record is currently used")
ELSE
Error(HErrorInfo())
END
END
Syntax
<Result> = <Source>.Forward([<Item> [, <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.
<Source>: Type corresponding to the specified source
Name of data file, view or query used.
PHP This parameter corresponds to a file name.
<Item>: Optional character string (with or without quotes)
Name of item according to which the browse is performed.
If this name is not specified, <Source>.Forward handles the last item of the data file used by the last HFSQL management function (function 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> 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.


    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.
    Java Access by JDBC: The management of locks is not available for databases accessed by JDBC.
  • 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: <Source>.ReadFirst, <Source>.First, <Source>.ReadSeekFirst, <Source>.SeekFirst, <Source>.ChangeKey, <Source>.ReturnPosition.
If the item used is a key item:
  • if the hDistinct constant is not specified, <Source>.Forward moves forward <Step> key values from the current position.
  • if the hDistinct constant is specified, <Source>.Forward moves forward <Step> 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.
  • <Source>.Forward 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. <Source>.SetMemo 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 (<Source>.ExtractMemo).
Reports and QueriesJavaUser code (UMC)AjaxHFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native 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 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.

Various

Component: wd260hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment