- Handling a crossed record
- Number of crossed records
- Version of data file
- Crossing a record from a query
- Special cases
- xBase files
HCross (Function) In french: HRaye
 Available only with these kinds of connection
// Crosses the record #123 HCross(Customer, 123)
// Cross the customer orders HReadSeekFirst(ORDERS, CUSTNUM, ValCustNum) WHILE HFound() = True HCross() HReadNext() END
Syntax
<Result> = HCross([<Data file> [, <Record number> [, <Options>]]])
<Result>: Boolean - True if the record was crossed,
- False if an error occurred (locked record, integrity error, ...). HErrorInfo returns more details.
<Data file>: Optional character string (with or without quotes) Name of HFSQL data file, query or view used. If this parameter corresponds to an empty string (""), the HCross function manipulates the last data file used by the last HFSQL management function (function starting with the letter H). <Record number>: Optional integer Number of the record to cross. If this parameter is not specified (equal to 0 or to the hCurrentRecNum constant), the current record will be crossed. <Options>: Optional constant Configures:- the lock mode applied to the crossed record. If no lock constant is specified, the crossed record is not locked.
| | hLockNo (default value) | No lock: the crossed record will not be locked. | hLockWrite | Lock in write mode: the current crossed record can be read and viewed (HRead) by another application but it cannot be re-enabled by another application. Only the current application can re-enable it. | hLockReadWrite | Lock in read/write: the current crossed record cannot be read or re-enabled by another application. |
The management of locks is only performed on HFSQL Client/Server data files or data files handled by a Native Access. An HFSQL Mobile record cannot be locked. Indeed, the operating system of Pocket PC does not allow you to lock records. - the integrity management applied to the crossed record.
| | hIgnoreIntegrity | Ignores the integrity check for this operation, even if the automatic integrity check is enabled (HSetIntegrity). | hCheckIntegrity | Checks the integrity for the operation, even if the automatic integrity check is disabled (HSetIntegrity). |
A WLanguage error occurs if the two constants are used at the same time. These constants have no effect on the cascading deletion.
Remarks Handling a crossed record - A crossed record will not be read:
- by the browse functions: HFirst, HLast, HNext, HPrevious, HReadFirst, HReadLast, HReadNext, HReadPrevious, HForward, HBackward
- by the search functions: HSeekFirst, HReadSeekFirst, HSeekLast, HReadSeekLast.
- A crossed record can be read by HRead.
- A crossed record can be re-enabled by HModify or HWrite.
- HState is used to find out the record status (active, crossed, deleted, ...).
- The physical location of a deleted record will only be reusable (by the HAdd function for example) after:
- or the execution of the HFree function,
- a reindex operation (with compression).
Number of crossed records HNbRec is used to find out the number of crossed records in the data file. Remark: For backward compatibility with WEBDEV 1.5/WINDEV 5.5, the number of crossed records can also be returned by the H.NbDel variable. Version of data file If the HCross function is successful, the version number of the data file is changed. This version number is returned by HVersion. Crossing a record from a query A record can be crossed: - in the query result.
- in the files handled by the query (hModifyFile constant used in HExecuteQuery or HExecuteSQLQuery). In this case, the hWithFilter constant is automatically selected.
Regardless of how the request is executed (with or without the hAh constant with SCHTRIME filter), the HCross function can only be used on single file requests. Caution: - No record can be crossed in a query that is using the groups or aggregates.
- The management of integrity and duplicates is not performed during the operations on the multi-file queries: we recommend that you use the transactions to avoid any problem.
Special cases - Managing locks:
If a lock problem occurs when "crossing" a record (attempt to cross a record locked in write mode for example), the record is not modified and HErrorLock returns True.
No management of locks is performed. Indeed, the operating system of Pocket PC does not allow you to lock records. - Managing the referential integrity
If the management of the referential integrity is enabled (HSetIntegrity) and if the integrity is not checked during the deletion, HCross is not run. HErrorIntegrity must be checked after HCross. - Deleted records
HCross must not be called on a record that was deleted beforehand.
This page is also available for…
|
|
|