[Lazarus] Extending TRect breaks Lazarus

Sven Barth pascaldragon at googlemail.com
Sat Nov 7 00:35:35 CET 2015


Am 06.11.2015 17:59 schrieb "Marco van de Voort" <marcov at stack.nl>:
>
> On Fri, Nov 06, 2015 at 05:42:39PM +0100, Michael Van Canneyt wrote:
> > > by Delphi compatibility...
> >
> > Ehm. How can "with" ever be safe ?
>
> Btw the case that I fixed was like this
>
> procedure TSomeForm.Getwind...
>
> procedure setwidthheight(const r : TRect); inline;
> begin
>  with R do
>    begin
>     width:=right-left;
>     height:=bottom-top;
>   end;
> end;
>
> begin
>  ...
>   setwidtheight(r);
> end
>
> In such case fixing with SELF doesn't work, because self isn't allowed in
> the nested function. I had to strip the WITH.

Self really isn't allowed in nested functions? O.o

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151107/c85213e8/attachment-0003.html>


More information about the Lazarus mailing list