<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello,<div><br></div><div>please consider the following partial code containing a read-only property (Owner):<br clear="all"><div><br></div><div><div><font face="monospace, monospace" size="1">...</font></div><div><font face="monospace, monospace" size="1"><div>class function TfrBase.Novo(AOwner: TComponent;</div><div>  ARequerLogin: Boolean): TfrBase;</div><div><br></div></font></div><div><font face="monospace, monospace" size="1">  procedure DoAccess; //inline</font></div><div><font face="monospace, monospace" size="1">  begin</font></div><div><font face="monospace, monospace" size="1">    Result := Self.CreateNew; // it will create a form</font></div><div><font face="monospace, monospace" size="1">    asm</font></div><div><font face="monospace, monospace" size="1">      Result.FOwner = AOwner;</font></div><div><font face="monospace, monospace" size="1">    end;</font></div><div><font face="monospace, monospace" size="1">    Result.Popup := True;</font></div><div><font face="monospace, monospace" size="1">  end;</font></div></div><div><font face="monospace, monospace" size="1">...</font></div><div><br></div><div>In the code above, I can't assign the new owner in an easy way like <span style="font-family:monospace,monospace;font-size:x-small">CreateNew(</span><span style="font-family:monospace,monospace;font-size:x-small">AOwner</span><span style="font-family:monospace,monospace;font-size:x-small">)</span>, cause the design of the third party component doesn't provide any overloaded option like <span style="font-family:monospace,monospace;font-size:x-small">CreateNew(AOwner: TComponent)</span>, then I've used the small asm block above to access the private field <font face="monospace, monospace" size="1">FOwner</font> and change it. However, I would like to solve it in the Pascal-ish way to avoid asm blocks.</div><div><br></div><div>Thank you!</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div></div></div></div></div></div>