[fpc-pascal] with statement using mulltiple objects

Luca Olivetti luca at ventoso.org
Sun Sep 14 13:13:03 CEST 2014


El 14/09/14 12:22, Jürgen Hestermann ha escrit:

>> ---------------------------------------------------------
>> d:=TreeRoot.SubDirs[Low(TreeRoot.SubDirs)]; // local var d
>> d^.DirLogged             := true;
>> d^.DirHatFocus           := false;
>> d^.SubDirsExpanded       := true;
>> [...] ---------------------------------------------------------
> 
> 
> Long-winded and still not the same clarity as in the with statement.

As I say every time this discussion comes up ;-), TI pascal had the best
of both worlds: you could either use the naked with or a named with,
which removed ambiguity, i.e.

with a=Label1,b=Label2 do
  a.caption:=b.caption;

(OK, it's a contrived example but you get the drift).

Bye
-- 
Luca



More information about the fpc-pascal mailing list