RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDictionary.TryGetValue Method

Try to get value for key.

Pascal
function TryGetValue(const Key: TKey; out Value: TValue): Boolean;
C++
__fastcall Boolean TryGetValue(const TKey Key, TValue Value);

TryGetValue returns true if the given key is in the dictionary and provides its value in Value. Otherwise, it returns false and Value is set to the default value type of TValue. No exception is raised if the key is not in the dictionary. This is an O(1) operation. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!