[Overview][Classes][Procedures and functions][Index] |
Adds the specified method to the list.
Source position: lazmethodlist.pas line 54
public procedure TMethodList.Add( |
const AMethod: TMethod |
); |
const AMethod: TMethod; |
AsLast: Boolean |
); |
AMethod |
|
Method to add to the list. |
AMethod |
|
Method to add to the list. |
AsLast |
|
Indicates if the method should be appended to the end of the list. |
Add is an overloaded procedure used to add the TMethod instance specified in AMethod to the Items in the list. Add 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 method in AMethod is appended to the end of the memory allocated to the Items property. ReAllocMem is used to set the new size for the memory allocation.
Add ensures the internal member used for the Count function is incremented when necessary.
An overloaded variant of the Add method includes the AsLast parameter. AsLast indicates if the position in items where the new method is stored. When AsLast is True, the method in AMethod is appended to the end of allocated memory using the Add method. When AsLast contains False, the Insert method is called to store the new method at the beginning of allocated memory.
|
Indicates if duplicate methods are allowed in the list. |
|
|
Gets the position where the specified method is stored in the list. |
|
|
Gets the number of items included in the method list. |
|
|
Inserts the specified method at the given position in the list. |
Version 4.0 | Generated 2025-05-03 | Home |