[fpc-pascal] Type-casting a class variable

Adriaan van Os adriaan at adriaan.biz
Thu May 2 08:29:00 CEST 2024


> In addition to what Martin said: as long as you have a non-static class 
> method the value of the variable you call the class method on (e.g. 
> myClass in your example) will be passed as Self parameter. So no need 
> for extra parameters. 

But how can myClass be passed ?

	myClass.CreateNewWindow

is not accepted by the compiler, because CreateNewWindow is not a method of TClass, whereas

	TWindow.CreateNewWindow

doesn't pass myClass.

Regards,

Adriaan van Os



More information about the fpc-pascal mailing list