[Lazarus] 'with' is evil, isn't it?

Hans-Peter Diettrich DrDiettrich1 at aol.com
Tue Aug 2 22:42:11 CEST 2011


Jürgen Hestermann schrieb:

> with Uebergabe^, Qarray[QuaderNr]^.Teilung[R] do
>   AusdehnungInMeter := (Feldgrenzen[length(Einteilungen)+1] -
>                                       Feldgrenzen[1]) *
>                                       
> EinheitAuswahl[Einheit.Koord[R]].Faktor;

This is very close to the explicit pointer version:

   U := Uebergabe;
   Q := Qarray[QuaderNr]^.Teilung[R];
   AusdehnungInMeter := (Q.Feldgrenzen[length(Einteilungen)+1] -
                         Q.Feldgrenzen[1]) * 
EinheitAuswahl[U^.Einheit.Koord[R]].Faktor;

Only the declarations for U and Q have to be added, and the debugger 
will have no problem with guessing the correct prefix.

DoDi





More information about the Lazarus mailing list