DEL, DELETE()

Top  Previous  Next

 

The DEL statement and DELETE() function delete a field, value or subvalue from a dynamic array.

 

 

Format

 

DEL dyn.array<field {, value {, subvalue}}>

DELETE(dyn.array, field {, value {, subvalue}})

 

where

 

dyn.arrayis the dynamic array from which the item is to be deleted.

 

fieldevaluates to the number of the field to be deleted.

 

valueevaluates to the number of the value to be deleted. If omitted or zero, the entire field is deleted.

 

subvalueevaluates to the number of the subvalue to be deleted. If omitted or zero, the entire value is deleted.

 

 

The specified field, value or subvalue is deleted from the dynamic array. The DEL statement assigns the result to the dyn.array variable. The DELETE() function returns the result without modifying dyn.array.

 

 

Example

 

DEL ITEMS<1,N>

 

This statement deletes field 1, value N from dynamic array ITEMS.

 

 

S = DELETE(ITEMS, 1, N)

 

This statement is similar to the previous example except that the result is assigned to S, leaving ITEMS unchanged.

 

 

See also:

EXTRACT(), FIND, FINDSTR, INS, INSERT(), LISTINDEX(), LOCATE, LOCATE(), REPLACE()