21. 4GL Statement Glossary : ArraySetRowDeleted()
 
Share this page                  
ArraySetRowDeleted()
Deletes an array record.
Syntax
returnfield = ] [callproc] arraysetrowdeleted
    (arr, rownumber = integerexpr)
returnfield
Specifies the name of field to which the result is returned. Integer.
You must include a value for returnfield if you omit the callproc keyword; otherwise it is optional.
arr
Specifies the name of an array
integerexpr
Specifies an expression that indicates the record number of the record to be deleted
Description
The arraysetrowdeleted() built-in function marks the specified record deleted (this does not actually remove the record from the array). The _state attribute of the record is changed to "Deleted."
The record is moved to the beginning of the array, and its _record attribute is changed accordingly. The first record to be deleted becomes record number "0," the second record to be deleted becomes record number "-1," and so on.
The procedure returns 0 on success, or a non-zero number on failure (that is, the record you specified does not exist).
Example
To mark a record from the array emparray deleted (the record remains in the array):
callproc arraysetrowdeleted 
  (emparray, rownumber = 2);