[Lazarus] Foreach?

Sven Barth pascaldragon at googlemail.com
Sat Jun 8 17:37:19 CEST 2013


On 08.06.2013 15:23, Antônio wrote:
>      for i := 0 to 9 do
>        TButton(Form1.FindComponent('btnMacro' + IntToStr(i +
> 1))).Caption := Macrolist[i].Name;

Also an interesting solution though that might have the problem that you 
basically do two loops (depending on the implementation of 
FindComponent). So doing that once on startup should be ok, otherwise I 
wouldn't use it...

Regards,
Sven





More information about the Lazarus mailing list