Sign in Join
FPDoc Onlineexperiment

TMethodList.Insert procedure

Member of TMethodListpublicIn unit LazMethodList

Inserts the specified method at the given position in the list.

Declaration

pascal
procedure Insert(Index: Integer; const AMethod: TMethod)

Arguments

Index

Ordinal position where the method will be inserted.

AMethod

Method to insert at the specified position.

Description

Insert is a procedure used to inset the specified method at the given position in Index.

Insert uses the value in AllowDuplicates to determine if the Items in the list need to be checked for duplicates prior to adding the specified method. When AllowDuplicates is False, the IndexOf method is used to locate an existing entry in Items with the method in AMethod. If the method does not exist in Items, or AllowDuplicates is True, the InternalInsert method is called to store the new method at the required position.

When Index is a valid ordinal position in Items, the Move method is called to relocate existing method entries in the list. The RaiseIndexOutOfBounds method is called if the value specified in Index is not in the range 0..Count-1.

Use Add to append a method at the end of the Items in the list.

Errors

Raises an EListError exception when Index contains an invalid ordinal position for Items in the list (not in the range 0..Count-1).

See also

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