IList.RemoveAt

Syntax

RemoveAt(Index: Integer);

Parameters

Index - position index of the element that should be removed.

Description

The RemoveAt method removes the element, which position index is passed by the Index parameter.

Example

Sub Main;

Var

ArrayL: IArrayList;

List: IList;

i: Integer;

Begin

ArrayL:=New ArrayList.Create;

List:=ArrayL As IList;

For i:=0 To Math.RandBetweenI(0,100) Do

List.Add(Math.RandBetweenI(0,50));

End For;

List.RemoveAt(List.Count-1);

End Sub Main;

After executing the example a dynamic array with random values is created, and the last element is removed from it.

See also:

IList