Add key-value pair even when key already exists.
AddOrSetValue adds a key-value pair to a dictionary even if the key already exists. The key cannot be nil, but the value can. This method checks to see if the key exists in the dictionary, and if it does, it is equivalent to Items[key] := value;. Otherwise it is equivalent to Add(key, value);.
An
OnKeyNotify event and an
OnValueNotify event occur indicating an entry was added to the dictionary.
Namespace: RSGenerics.Collections
Delphi |
public |
Parameters
Key
Type: TKey
Value
Type: TValue