DEL

Use the DEL statement to remove a specified element of a dynamic array.

COMMAND SYNTAX

    DEL variable<expression1{, expression2{, expression3}}>

SYNTAX ELEMENTS

The variable can be any previously assigned variable or matrix element. The expressions must evaluate to a numeric value or a runtime error will occur.

expression1 specifies the field in the array to operate upon and must be present.

expression2 specifies the multivalue within the field to operate upon and is an optional parameter.

expression3 is optionally present when expression2 has been included. It specifies which subvalue to delete within the specified multivalue.

NOTES

Truncates non-integer values for any of the expressions to integers

Ignores invalid numeric values for the expressions without warning

The command operates within the scope specified, i.e. if specifying only a field then it deletes the entire field (including its multivalues and subvalues). If specifying a subvalue, then it deletes only the subvalue leaving its parent multivalue and field intact.

EXAMPLE

       Numbers = ''
       FOR I = 1 TO 20
          Numbers<I> = I   ;*generate numbers
       NEXT I
       FOR I = 19 TO 1 STEP -2
          DEL Numbers<I>   ;* remove odd numbers
       NEXT I
       CRT CHANGE(Numbers, @FM, '>')  ;* 2>4>6>8>10>12>14>16>18>20
Last update: Sat, 16 Jul 2022 15:34