PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Handling a crossed record
  • Number of crossed records
  • Version of data file
  • Crossing a record from a query
  • Special cases
  • xBase files
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
Crosses a record in a data file. The record is deleted logically and it can be retrieved if necessary.
The following operations are performed:
  • the record becomes inactive. The data is stored (which is not the case when a record is deleted by HDelete).
  • the indexes (corresponding to the record keys) are deleted from the index file.
  • the memos associated with the record are stored.
This function can be used on the data files, the HFSQL Mobile views or the queries.
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
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 20 and later
Android This function is now available for the Android applications (for the HFSQL data files).
WINDEVJava This function is now available for the Java applications (for the HFSQL data files).
Android Widget This function is now available in Android Widget mode (for the HFSQL data files).
New in version 20
Android This function is now available for the Android applications (for the HFSQL data files).
WINDEVJava This function is now available for the Java applications (for the HFSQL data files).
Android Widget This function is now available in Android Widget mode (for the HFSQL data files).
Android This function is now available for the Android applications (for the HFSQL data files).
WINDEVJava This function is now available for the Java applications (for the HFSQL data files).
Android Widget This function is now available in Android Widget mode (for the HFSQL data files).
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.
Example
// Crosses the record #123
HCross(Customer, 123)
// Cross the customer orders
HReadSeekFirst(ORDERS, CUSTNUM, ValCustNum)
WHILE HFound() = True
        HCross()
        HReadNext()
END
Syntax
<Result> = HCross([<File Name> [, <Record Number> [, <Options>]]])
<Result>: Boolean
  • True if the record was crossed,
  • False if an error occurred (locked record, integrity error, ...). HErrorInfo returns more details.
<File Name>: Optional character string (with or without quotes)
Name of HFSQL data file, query or view used.
If this parameter corresponds to an empty string (""), HCross handles the last data file used by the last function for HFSQL management (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.
    hLockWriteLock in write mode: the crossed record can be read (HRead) by another application but it cannot be re-enabled by another application. Only the current application can re-enable it.
    hLockReadWriteLock in read/write: the current crossed record cannot be read or re-enabled 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.
  • the integrity management applied to the crossed record.
    hIgnoreIntegrityIgnores the integrity check for this operation, even if the automatic integrity check is enabled (HSetIntegrity).
    hCheckIntegrityChecks 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

Number of crossed records

HNbRec is used to find out the number of crossed records in the data file.
Note: 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 HCross is successful, the version number of data file is modified. 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 the runtime mode of query (with or without the hWithFilter constant), HCross can only be used on the single-file queries.
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.
    Windows Mobile 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.
WINDEVWEBDEV - Server codeNative Accesses

xBase files

HDelete and HCross have the same effect: the record is crossed but it is not deleted. Therefore, the record can be re-enabled by HModify. In this case, HState returns the hStateCrossed constant for a deleted record (instead of hStateDel).
Components
WINDEVWEBDEV - Server code 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