Alexander Klenin wrote: > 1) Iterating over array property, where and item should be stored in a > temporary variable > to avoid rereated calls to GetItem method inside the loop iteration: > var > i: integer; item: TItem; > ... > for i := 0 to obj.ItemCount do begin > item := Items[i]; > ... item ... item ... > end; > > versus > > var > item: TItem; > ... > for item in obj.Items do begin > ... item ... item ... > end; > > the latter is safer, simpler and more clear code.
ehm, what if I want it reversed ? and how should the compiler know that there are Count items ? Marc _______________________________________________ Lazarus mailing list [email protected] http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
