PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Modifies the current record if it exists, otherwise adds a new record.
Example
ScreenToFile(Customer)
HSave(Customer)
Syntax
<Result> = HSave([<Data file> [, <Options>]])
<Result>: Boolean
  • True if the addition or the modification was performed,
  • False if an error occurred.
<Data file>: Optional character string
Name of the data file, view or query used. If this name is not specified, HSave will use the last data file used by the last HFSQL function (function starting with "H").
<Options>: Optional integer constant
Used to configure:
  • the effect of addition or modification on the current iteration.
  • the mode for calculating the automatic identifier. For more details, see Managing the automatic identifier during an addition.
  • the lock mode of the added or modified record.
  • the management of duplicates.
  • the management of integrity.
Hyper File 5.5 This parameter is ignored.
hAffectBrowseEffect of the adidtion/modification on the iteration: The addition or the modification affects the iteration.
For example, HReadNext used after HSave positions on the record found after the added/modified record.
The hAffectBrowse constant has priority over the hWriteDefault constant.
hCheckDuplicatesManagement mode of duplicates: Checks for duplicates for this operation, even if the duplicate check is disabled (HSetDuplicates).
A WLanguage error occurs if the hIgnoreDuplicates and hCheckDuplicates constants are used at the same time.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hCheckIntegrityManagement mode of integrity: Checks the integrity of operation even if the automatic integrity check is disabled (HSetIntegrity).
A WLanguage error occurs if the hIgnoreIntegrity and hCheckIntegrity constants are used at the same time.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hForceIDAutoMode for calculating the automatic identifier: The automatic identifier is not calculated during the addition. The identifier corresponds to:
  • the value assigned to the item through programming (CUSTOMERID = 7 for example)
  • the default identifier value specified in the data model editor (if the data file was just opened, with no record read)
  • the identifier value found in memory (identifier value for the last record read in the data file).
Once the record is added, the next automatic identifier calculated by the HFSQL engine will be calculated while ignoring the value added by hForceIDAuto.
A WLanguage error occurs if the hSetIDAuto and hForceIDAuto constants are used at the same time.
hIgnoreDuplicatesManagement mode of duplicates: Does not check for duplicates for this action, even if the automatic duplicate check is enabled (HSetDuplicates).
A WLanguage error occurs if the hIgnoreDuplicates and hCheckDuplicates constants are used at the same time.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hIgnoreIntegrityManagement mode of integrity: Ignores the integrity check for this add operation, even if the automatic integrity check is enabled (HSetIntegrity).
A WLanguage error occurs if the hIgnoreIntegrity and hCheckIntegrity constants are used at the same time.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hLockNo
(default value)
Mode for locking the added or modified record: No lock: the added or modified record will not be locked.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hLockReadWriteMode for locking the added or modified record: Lock in read/write: the added or modified record will be locked in read/write. This record cannot be read or modified by another application. Only the current application can modify it, read it or unlock it.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hLockWriteMode for locking the added or modified record: Lock in write mode: the added or modified record will be locked in write mode. This record can be read by another application but it cannot be modified by another application. Only the current application can modify it or unlock it.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hRecalculateIDAutoMode for calculating the automatic identifier: The automatic record identifier will be recalculated during the write operation. This constant has priority over hForceIDAuto and hSetIDAuto.
hSetIDAutoMode for calculating the automatic identifier: The automatic identifier is not calculated during the addition: the identifier value will be the one stored during the addition.
The next identifier value calculated by the HFSQL engine will correspond to the greatest identifier value in the file +1.
A WLanguage error occurs if the hSetIDAuto and hForceIDAuto constants are used at the same time.
hWriteDefault
(default value)
Effect of the adidtion or modification on the iteration: The addition or the modification does not affect the current iteration.
For example, HReadNext used after HSave positions on the record found after the current record before the addition or modification.
The hAffectBrowse constant has priority over the hWriteDefault constant.
Remarks
  • If the NewRecord property is set to True, HSave adds the record to the data file (HAdd). For more details, see the documentation about HAdd.
  • If NewRecord is set to False, HSave modifies the record in the data file (HModify). For more details, see the documentation about HModify.
Business / UI classification: Business Logic
Component: wd280hf.dll
Minimum version required
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment