Skip to main content

DEL

Deletes an element from a dynamic array.

Synopsis

DEL dynarray <f[,v[,s]]>

Arguments

dynarray Any valid dynamic array.
f An integer specifying the Field (attribute) level of the dynamic array on which to perform the deletion. Fields/Attributes are counted from 1.
v Optional — An integer specifying the Value level of the dynamic array on which to perform the deletion. Values are counted from 1 within a Field.
s Optional — An integer specifying the Subvalue level of the dynamic array on which to perform the deletion. Subvalues are counted from 1 within a Value.

Description

The DEL statement deletes one element from a dynamic array. It deletes both the data and the dynamic array delimiter. Which element to delete is specified by the f, v, and s integers. The enclosing angle brackets are mandatory. For example, if f=2 and v=3, this means delete the third value from the second field. If f=2 and v is not specified, this means to delete the entire second field.

The DEL statement and the DELETE function perform the same operation, with the following difference: DEL changes the supplied dynamic array; DELETE creates a new dynamic array with the specified change and leaves the supplied dynamic array unchanged.

Examples

The following example uses the DEL statement to delete the second value from the first field of a dynamic array:

cities="New York":@VM:"London":@VM:
"Chicago":@VM:"Boston":@VM:"Los Angeles"
PRINT cities
    ! Returns: "New YorkýLondonýChicagoýBostonýLos Angeles"
DEL cities <1,2>
PRINT cities
    ! Returns: "New YorkýChicagoýBostonýLos Angeles"

See Also

FeedbackOpens in a new tab