[Lazarus] Weird object variables access [SOLVED] - Delphi mode bug!

Giuliano Colla giuliano.colla at fastwebnet.it
Thu Oct 26 18:43:56 CEST 2017


Il 25/10/2017 17:15, Sven Barth ha scritto:
> That's not what I asked. The documentation used a procedure pointer 
> type, thus the documentation would still be correct if it works as the 
> allowed usage of a method pointer type in past versions would then 
> indeed have been a bug in Delphi. 

In Delphi 7 with just a procedure pointer it accepts both forms. If P is 
a generic pointer and PTS is defined as a Procedure Pointer type, you 
may write either

P := @myProcedure;
PTS := P;
PTS;

or

P := @myProcedure;
@PTS := P;
PTS;

In both cases no error is given and myProcedure is properly called.

As soon as I can put my hands on the right platform, I'll verify what 
happens with Rad Studio X10, and will let you know.

However I'm planning to pass this topic to the fpc list, where I think 
now it belongs.

Giuliano




More information about the Lazarus mailing list