Sign in Join
FPDoc Onlineexperiment

TFPSList.Insert procedure

Member of TFPSListpublicIn unit fgl

Insert a new item in the list.

Declaration

pascal
procedure Insert(Index: Integer; Item: Pointer)
function Insert(Index: Integer): Pointer

Arguments

Index

Index at which to insert the new item in the list.

Item

Item to insert in the list.

Function result

Newly allocated slot in the list.

Description

Insert comes in 2 overloaded version. The version without Item creates a slot for a new item at position Index in the list, and returns a pointer to the new slot. The slot will be of size ItemSize.

The version with Item argument will allocate a slot in the list at position Index and will copy the item pointed to by Item to the slot in the list.

In both cases, Index must be 0-based.

Errors

If Index is invalid, an EListError exception will be raised.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.