Access/VBA Library

Delete Method

Removes the element at the given position from the array.

Syntax

array_.Delete( Index )
Parameters
Name Type Description
array_   The name of an object of type array_
Index Integer Required. Points to the location of the element in the array.
Example
  Dim x As New Array_

  x.FromArray (Array(1, 2, 3, "To be deleted", 4, 5))
  x.Delete (4)
  ' Result :
  'Array (
  ' [1] = > 1
  ' [2] = > 2
  ' [3] = > 3
  ' [4] = > 4
  ' [5] = > 5
  ')
  ' Shorthand coding:
  x.FromArray(Array(1, 2, 3, "To be deleted", 4, 5)).Delete(4)