Sign in Join
FPDoc Onlineexperiment

TFPGMapObject.Add function

Member of TFPGMapObjectpublicIn unit fgl

Add a key and value to the map.

Declaration

pascal
function Add(const AKey: TKey; const AData: TData): Integer
function Add(const AKey: TKey): Integer

Arguments

AKey

Key value.

AData

Data item.

Function result

Index of the new key.

Description

Add adds a new key AKey of generic type TKey with data object AData to the list and returns the position at which the key was added.

Errors

If the item could not be added, an EListError exception is raised. If Duplicates is set to dupError and a duplicate key is added, an EListError exception is raised.

See also

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