Add( ) method (Map Collections)
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Adds a key-value pair to the collection. The method returns TRUE if the key is added to the
map, otherwise it returns FALSE, which means that the key is already in the map
according to the equality comparer implementation. The added key must implement
Progress.Collections.IHashable, if using the default comparer
implementation. The comparer implementation decides if a key object is the same as
another one in the collection.
Return type: LOGICAL
Access: PUBLIC
Applies to: Progress.Collections.HashMap<K,V> class
Syntax
|
- key
- The key object to be added to the collection.
- value
- The object to be associated with key.
- pair
- The key-value pair object to be added to the collection.
The method raises an error if:
- The key object does not implement
Progress.Collections.IHashable, if using the default equality comparer implementation. - The key object is not a valid object reference (including the Unknown value
(
?)), if using the default equality comparer. - The equality comparer object specified via the specific constructor has become invalid.
- The custom equality comparer raises an error.