I am porting a Delphi class to FPC and I ran into a problem concerning TList:
FCommands.Sort(CommandCompare); This generates an error: Error: Wrong number of parameters specified for call to "CommandCompare" This call works just fine in Delphi and I have no clue as to why it happens in FPC. CommandCompare is a function that will compare two items based on the properties of the object so the sort will be based on object properties. In this call to Sort the function is passed as a parameter rather than being called... >From Delphi help: Delphi syntax: procedure Sort(Compare: TListSortCompare); Description Call Sort to sort the items in the Items array. Compare is a comparison function that indicates how the items are to be ordered. I tried to typecast the function but it does not change anything: FCommands.Sort(TListSortCompare(CommandCompare)); What am I missing? -- Bo Berglund Developer in Sweden _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal