[lazarus] FPC Request

Florian Klaempfl Florian.Klaempfl at gmx.de
Mon Oct 25 16:04:10 EDT 1999


Shane Miller wrote:
> 
> Another request:
> 
> Delphi allows you to assign a Pointer variable to a TObject by doing the conversion for you, so you don't need to typecast it.
> For example
> 
> Var
> P: Pointer;
> T: TObject;
> 
> Begin
> 
> P := T;
> 
> End;
> 
> FPC makes you typecast T as a Pointer.

No problem here!

> 
> Also, the other way around should work too.
> 
> T := P;
> 
> so I don't need to typecast P as a TObject.
> 
> Could this be done?

Hmmm, I don't know if this should done! It seems to be dangerous. If someone
wants to assign a pointer to tobject, he should know what he do and type cast it!






More information about the Lazarus mailing list