Re: [fpc-pascal] Get TMethod from function reference

2022-09-14 Thread Sven Barth via fpc-pascal
Am 08.09.2022 um 16:55 schrieb Hairy Pixels via fpc-pascal: A function reference can call a class method but can you get the TMethod data from function references? It was possible with “is object” to cast to TMethod but that doesn’t seem to be possible with references. = type TMyCl

Re: [fpc-pascal] Access Violation When SetLength(DynArray, Value)

2022-09-14 Thread Sven Barth via fpc-pascal
Am 10.09.2022 um 01:41 schrieb James Richters: I thought I would make my own IncArray() function: Procedure IncArray(Var TheArray); Begin SetLength(TheArray,Length(TheArray)+1); End; But I get a 'Type Mismatch' Any ideas how this could be done? Is this even possible without specifying the

Re: [fpc-pascal] How to assign overloaded event handler?

2022-09-14 Thread Michael Van Canneyt via fpc-pascal
On Wed, 14 Sep 2022, Thomas Kurz via fpc-pascal wrote: I don't know whether this is actually a bug or not but I cannot find a hint in the documentation. It seems that methods assigned to an event handler are not allowed to be overloaded. Or, to be more precise, FPC always uses the first de

[fpc-pascal] How to assign overloaded event handler?

2022-09-14 Thread Thomas Kurz via fpc-pascal
I don't know whether this is actually a bug or not but I cannot find a hint in the documentation. It seems that methods assigned to an event handler are not allowed to be overloaded. Or, to be more precise, FPC always uses the first declaration regardless whether it fits or not. Example: pro