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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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 _______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: [email protected] Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
