Vote UpVote

Delphi: updating a (potentially non-existing) item in a generic TDictionary: use ExtractPair. Except in Delphi 2010/XE.

The Wiert Corner – “Documented” in Delphi 2010, [Archive.is] Generics.Collections.TDictionary.ExtractPair – RAD Studio VCL Reference, and functioning bug-free since Delphi XE2, but still hardly documented, [Archive.is] System.Generics.Collections.TDictionary.ExtractPair – XE2 API Documentation is the easiest way to get a value out of a dictionary and updating it, even if it does not exist. ExtractPair extracts the TPair<TKey, TValue> if it exists (and removes it from the dictionary) or returns a Default initialised one if not. Though Default is still not documented, you can find an ...
Favorite? Off-Topic? jpluimers @ 2018-11-06 19:05


Visits: 158
Votes: 1
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)