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 > > try > > // Do things with Q > > finally > > Q.Close; > > end; > > var > Q: TQuery absolute QMyVeryLongQueyObjectName; > begin > with Q do > try > // Do things with Q > finally > Q.Close; > end; > > > 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.
Martin -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
