[Lazarus] Extending TRect breaks Lazarus
Michael Van Canneyt
michael at freepascal.org
Fri Nov 6 19:02:48 CET 2015
On Fri, 6 Nov 2015, Martin Schreiber wrote:
> 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
>>> // Do things with Q
>> Q: TQuery absolute QMyVeryLongQueyObjectName;
>> with Q do
>> // Do things with Q
>> 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.
Indeed, and besides this:
a) it does not compile for properties. See below.
b) I did mention the requirement about non-trivial readable variable names...
TMyType = class(TObject)
function GetM: TMyType;
procedure SetM(AValue: TMyType);
Property MyVeryLongObjectPropertyName : TMyType Read GetM Write SetM;
function TMyType.GetM: TMyType;
procedure TMyType.SetM(AValue: TMyType);
Q : TMyType absolute MyVeryLongObjectPropertyName; // Error !!!
More information about the Lazarus