Logo

Programming-Idioms

History of Idiom 8 > diff from v9 to v10

Edit summary for version 10 by :

Version 9

2015-08-21, 23:04:46

Version 10

2015-08-23, 23:44:30

Idiom #8 Initialize a new Map (associative array)

Declare a new map object x, and provide some (key, value) pairs as initial content.

Idiom #8 Initialize a new Map (associative array)

Declare a new map object x, and provide some (key, value) pairs as initial content.

Imports
uses fgl;
Code
type TMap = specialize TFPGMap<String, Integer>;
var x: TMap;

begin
  x := TMap.Create;
  x['one'] := 1;
  x['two'] := 2;  
end.
Doc URL
http://wiki.freepascal.org/Generics#fgl_unit