DELETE ELEMENT

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 3


DELETE ELEMENT (array; where{; howMany})

ParameterTypeDescription
arrayArrayArray from which to delete elements
whereNumberElement at which to begin deletion
howManyNumberNumber of elements to delete, or
1 element if omitted

Description

The DELETE ELEMENT command deletes one or more elements from array. Elements are deleted starting at the element specified by where.

The howMany parameter is the number of elements to delete. If howMany is not specified, then one element is deleted. The size of the array shrinks by howMany.

Examples

1. The following example deletes three elements, starting at element 5:

   DELETE ELEMENT (anArray; 5; 3)

2. The following example deletes the last element from an array, if it exists:

   $vlElem:=Size of array(anArray)
   If ($vlElem>0)
      DELETE ELEMENT (anArray;$vlElem)
   End if

See Also

INSERT ELEMENT, Size of array.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next