type
TKey = TSomeType;
TData = TSomeOtherType;
TMap = specialize TFPGMap<TKey, TData>;
...
c := TMap.Create;
for idx := 0 to a.count-1 do
begin
c.Add(a.keys[idx],a.data[idx]);
end;
for idx := 0 to b.count-1 do
begin
c.AddOrSetData(b.keys[idx],b.data[idx]);
end;
If a key exists in both a and b, the value of said key in c will be the value as in b.
%c = (%a, %b);
Hash %c is assigned all the key-value pairs of %a then all the pairs of %b. The values of any duplicate keys in %b will overwrite those of %a.
c = {**a, **b}
a, b, c are dicts.
For any common key, the value from b overwrites the value from a.
type
TKey = TSomeType;
TData = TSomeOtherType;
TMap = specialize TFPGMap<TKey, TData>;
...
c := TMap.Create;
for idx := 0 to a.count-1 do
begin
c.Add(a.keys[idx],a.data[idx]);
end;
for idx := 0 to b.count-1 do
begin
c.AddOrSetData(b.keys[idx],b.data[idx]);
end;