[DUG] Why use a set when a string will work OK (and less code )?
Ross Levis
ross at stationplaylist.com
Fri May 11 21:36:18 NZST 2007
I tend to do this as well when it is obviously quite safe and saves a lot of
typing. The problem is debugging. The debugger (in D7 anyway) will not
resolve the variables unless they are fully qualified on the line. I have
always found this very annoying. Code Insight resolves everything fine in
the IDE, just the debugger is the problem.
Ross.
-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On
Behalf Of John Bird
Sent: Friday, 11 May 2007 19:16
To: 'NZ Borland Developers Group - Delphi List'
Subject: RE: [DUG] Why use a set when a string will work OK (and less code
)?
I thought using "with" with a single argument, not nested, would be a clean
and elegant practice, like:
with stringgrid1 do
begin
cells[5,tcgmax]:=uline;
cells[6,tcgmax]:=uline;
nextstrgrdMaTC;
cells[3,tcgmax]:='Totals';
cells[5,tcgmax]:=inttostr(trntotu);
cells[6,tcgmax]:=xfformat('deitos','',trntot,10,2);
end;
It doesn't confuse the Code Insight either (something Malcolm Groves said is
a disadvantage of using it....)
John
h Subject: unsubscribe
More information about the Delphi
mailing list