Deletes an element from a dynamic array.
||An expression that resolves to a dynamic array.
||An expression that resolves to an integer. Specifies the Field level of the dynamic array on which to perform the deletion. Fields are counted from 1.
||Optional An expression that resolves to an integer. Specifies the Value level of the dynamic array on which to perform the deletion. Values are counted from 1 within a Field.
||Optional An expression that resolves to an integer. Specifies the Subvalue level of the dynamic array on which to perform the deletion. Subvalues are counted from 1 within a Value.
function returns a dynamic array with one element deleted. It deletes both the data and the dynamic array delimiter. Which element to delete is specified by the f
, and s
integers. 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.
function and the DEL
statement 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.
The following example uses the DELETE
function to delete the second value from the first field of a dynamic array:
! Returns: "New YorkýLondonýChicagoýBostonýLos Angeles"
! Returns: "New YorkýChicagoýBostonýLos Angeles"
UniData systems differ in how they handle f
, and s
arguments set to 0. The $OPTIONS ATTR.0IS1 (zero is one) provides support for this UniData feature. UniData systems ignore v
arguments that are set to a negative number.
© 1997-2019 InterSystems Corporation, Cambridge, MA