Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-14 Thread Ryan Joseph via fpc-pascal
> On Feb 15, 2022, at 2:09 PM, Michael Van Canneyt via fpc-pascal > wrote: > > I've answered this question before: > > The "Reference to procedure" that will be part of anonymous functionswill do > this for you. I'm sorry I forgot! This thing keeps coming up for me and driving me nuts but I

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-14 Thread Michael Van Canneyt via fpc-pascal
On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote: This has been a constant problem for me with FPC and wanted to make a formal post with code examples since I've only mentioned it in passing before. How can it be achieved to have a caller agnostic procedure variables? I've tried making

[fpc-pascal] Caller agnostic procedure variables

2022-02-14 Thread Ryan Joseph via fpc-pascal
This has been a constant problem for me with FPC and wanted to make a formal post with code examples since I've only mentioned it in passing before. How can it be achieved to have a caller agnostic procedure variables? I've tried making some big crazy dispatch record that uses generics but becau

Re: [fpc-pascal] Sorting a Stringlist on ValueFromIndex

2022-02-14 Thread Michael Van Canneyt via fpc-pascal
On Mon, 14 Feb 2022, James Richters via fpc-pascal wrote: Is there a quick way to sort a stringlist on it's .ValueFromIndex field instead of it's .Names field? // Custom compare function function CompareValues(List: TStringList; Index1, Index2: Integer): Integer; begin Result:=Compar

[fpc-pascal] Sorting a Stringlist on ValueFromIndex

2022-02-14 Thread James Richters via fpc-pascal
Is there a quick way to sort a stringlist on it's .ValueFromIndex field instead of it's .Names field? James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] bug or feature?

2022-02-14 Thread Elmar Haneke via fpc-pascal
This can't be right, can it? type TBird = class procedure Fly; end; TEagle = TBird; // alias procedure TEagle.Fly; begin end; It does depend on what you expect an Type-Alias to be. If you expect the compiler to generate an compatible class then your example must not be compi