type
TList = specialize TFPGList<TKey>;
TMap = specialize TFPGMap<TKey, TData>;
var
m: TMap;
k: TList;
begin
....
k := TList.Create;
for idx := 0 to m.Count-1 do k.Add(m.Keys[idx]);
.....
k.Free;
....
TKey and TData can be of any type except a class.
@k = keys %m;
The keys function extracts the keys from a hash and returns them as a list.
type
TList = specialize TFPGList<TKey>;
TMap = specialize TFPGMap<TKey, TData>;
var
m: TMap;
k: TList;
begin
....
k := TList.Create;
for idx := 0 to m.Count-1 do k.Add(m.Keys[idx]);
.....
k.Free;
....