[Lazarus] Extending TRect breaks Lazarus

Martin Schreiber mse00000 at gmail.com
Fri Nov 6 18:58:27 CET 2015


On Friday 06 November 2015 18:33:54 Graeme Geldenhuys wrote:
> On 2015-11-06 17:19, Michael Van Canneyt wrote:
> > With QMyVeryLongQueyObjectName as Q do
> >    try
> >      // Do things with Q
> >    finally
> >      Q.Close;
> >    end;
>
> var
>   Q: TQuery absolute QMyVeryLongQueyObjectName;
> begin
>   with Q do
>     try
>       // Do things with Q
>     finally
>       Q.Close;
>     end;
>
>
> problem solved! ;-)
>
Not a good idea IMHO, that hinders readability because one doesn't see the 
real container at the "with" block start. Another important use of "with" is 
to make complex address calculations only once at the "with" block start 
without the need to define a pointer variable in "var" and to dereference in 
every statement.

Martin




More information about the Lazarus mailing list