[Overview][Classes][Procedures and functions][Index] Reference for unit 'LazMethodList' (#lazutils)

TMethodList.Insert

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

Declaration

Source position: lazmethodlist.pas line 56

public procedure TMethodList.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

TMethodList.AllowDuplicates

  

Indicates if duplicate methods are allowed in the list.

TMethodList.Count

  

Gets the number of items included in the method list.

TMethodList.Move

  

Moves the position for the specified method in the list.


Version 4.0 Generated 2025-05-03 Home