ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Read operation according to a key item or not
  • Memos
  • Lock
  • Miscellaneous
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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 into memory: HFSQL variables are updated (e.g. Customer.Name, i.e. the field Name field of the data file Client).
Several cases may occur after the call to <Source>.Forward:
  • there are no more records in the data file: function <Source>.Out returns True. No read operation is performed.
  • the function attempts to block a record already blocked in play mode: function HErrorLock returns True and function <Source>.Out returns True.
    PHP Management of locks not available in PHP.
    Java JDBC access: lock management is not supported for databases that are accessed through JDBC.
    Android Management of locks not available in SQLite databases.
This function can be used with the data files, HFSQL views or queries.
Example
// Avance jusqu'au 2000ième enregistrement
// du fichier de données Client selon la clé NomClient
Client.LitPremier(NomClient)
Client.Avance(NomClient, 1999)
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)HFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses)
// Test du compte-rendu de la fonction <Source>.Avance
// Avance jusqu'au 2000ième enregistrement
// du fichier de données Client selon la clé NomClient
Client.LitPremier(NomClient)
IF Client.Avance(NomClient, 1999, hLockWrite) = False THEN 
	IF HErrorLock() = True THEN
		Info("Cet enregistrement est en cours d'utilisation")
	ELSE
		Error(HErrorInfo())
	END
END
Syntax
<Result> = <Source>.Forward([<Item> [, <Step> [, <Options>]]])
<Result>: Boolean
  • True if the data file has been scrolled,
  • False in case of error (block, end of data 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
Name of item according to which the browse is performed.
If this name is not specified, <Source>.Forward handles the last item in the data file used by the last HFSQL function (function starting with "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 blocking: the Record can be played back or modified by another application during playback.
    hLockReadWriteRead/write lock: the record being read cannot be read or modified by another application.
    hLockWriteWrite lock: the record currently read can be read by another application but it cannot be 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 JDBC access: lock management is not supported for databases that are accessed through JDBC.
    AndroidAndroid Widget Management of locks not available in SQLite databases.
  • the management of duplicates during the browse. By default, all duplicates are iterated over.
    hDistinctOnly one record is read if duplicates are found when looping through a key item.
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 route must have been initialized with one of the following functions: <Source>.ReadFirst, <Source>.First, <Source>.ReadSeekFirst, <Source>.SeekFirst, <Source>.ChangeKey, <Source>.RestorePosition.
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).

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.
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.
PHP Locks are not supported.

Miscellaneous

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

Last update: 12/02/2024

Send a report | Local help