DEL Statement

The DEL statement deletes an attribute, value, or subvalue from a specified dynamic array.

Format

DEL array < attr#[, value# [,subval#]] >

Parameter(s)

array

Dynamic array to be changed.

attr#

An expression evaluating to the attribute number. If attr# is equal to 0, the entire array is deleted.

value#

An expression evaluating to the value number. If value# is omitted or equal to 0, the entire attribute is deleted.

subval#

An expression evaluating to the subvalue number. If subval# is omitted or equal to 0, the entire value is deleted.

Description

The DEL statement is the equivalent of the DELETE function, and may be used to delete an attribute, value, or subvalue from an array.

If the attribute, value, or subvalue expressions evaluate to a negative number or a number greater than the number accessible, no action is taken. If the expression evaluates to a noninteger value, it is truncated to an integer value.

The DEL statement is not the same as using the REPLACE function to replace the element with the null string (""). The REPLACE function removes the data while leaving the delimiters intact, but the DEL statement removes the delimiters as well as the data. For example, replacing Attribute 2 of an array with "" leaves an empty Attribute 2, but deleting Attribute 2 forces Attribute 3 to become Attribute 2, Attribute 4 to become Attribute 3, and so on.

Example

To delete Value 3 of Attribute 5 of the array RECORD, the code would read:

DEL RECORD < 5, 3 >

See Also

Statement and Function Reference