GetValue( ) method (Map Collections)
- Last Updated: March 15, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Returns the value object from the collection that matches the key passed in, if it can be
found, according to the equality comparer implementation (default or custom),
otherwise it returns the Unknown value (?). Note that the
implementation always uses the comparer when determining if the key can be found in
the collection.
Return type: V
Access: PUBLIC
Applies to: Progress.Collections.HashMap<K,V> class
Syntax
|
- key
- The key to locate in the collection.
This 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.
Note that if you store the Unknown value (?) as the value associated
with a key, the return value will be ambiguous as the Unknown value
(?) could mean the key was not found. Use
TryGetValue() instead, in that case.