writeempty
Syntax
WRITEEMPTY (facsname)
Meaning
The WRITEEMPTY instruction creates an empty record in the database table referred to by facsname. The purpose of this is to obtain the future record number in a before storage ADAPL. Otherwise you would not know the record number until the record was written. This function can also be used in import adapls. Do make sure that you only write an empty record if you are certain the empty record will also be filled by the adapl with any mandatory values, because otherwise the adapl will have created a completely empty record in your database. The implicit lock will be removed by WRITEEMPTY automatically.
Example
if (val (%0) = 0) {
/* only if new record
writeempty (_LOCAL)
}
Result
The record is stored and %0, the record number tag, is filled. This is only relevant in the case of a new record, i.e. if the record number is still ‘0’.
NB: _LOCAL is a special FACS name for general use. _LOCAL points simply to the currently opened database table. So for reading and writing of records it’s not necessary to hard code the FACS name of the database table.
See also
Click here for general information about FACS.