[fpc-pascal] Case statement for class introspection

Sven Barth pascaldragon at googlemail.com
Mon Jan 17 23:28:08 CET 2022


Am 17.01.2022 um 13:58 schrieb Ryan Joseph via fpc-pascal:
>
>> On Jan 17, 2022, at 5:09 PM, Sven Barth <pascaldragon at googlemail.com> wrote:
>>
>> The VMT writer already does that, cause the VMT pointer is required for each constructor call.
>>
> The pointer to the VMT table is just PVmt(self) right? If I make a program and do:
>
> writeln(PtrUInt(TObject.ClassType));
>
> the address changes every time the program reloads (as expected) so how do you use a constant memory address which would map to this?

The values will have the same differences between each other upon each 
start so ideally this would work anyway, but if one also throws dynamic 
packages into the mix things would get messed up. So better stay with 
the if-clauses.

Regards,
Sven


More information about the fpc-pascal mailing list