Hello,
I'm experimenting with sorting a string->int map by data value using the onDataCompare function.
So I have defined my map:
TStringIntMap = specialize TFPGMap<String,Integer>;
In the class I want to use this I have
TSomeClass = class
private
fMap:TStringIntMap;
function compare(const d1,d2:integer):integer;
public
constructor create;
end;
and in the constructor I have
constructor create
begin
fMap:=TStringIntMap.create;
fMap..OnDataCompare:=@compare;
end;
this looks pretty similar to the example but fails to compile with the error
Incompatible type for arg no. 1: Got "<procedure variable type of function(const LongInt;const LongInt):LongInt of object;Register>", expected "TFPGMap$2$crc3DEDFEAF.<procedure variable type of function(const LongInt;const LongInt):LongInt;Register>"
and I'm not sure what that means. What is the difference between 'LongInt of object;Register' and 'LongInt;Register' ?
Anyway - if anyone has any suggestions I'd be most grateful.
Cheers
John