For a single loop, maybe this, if was not so complicated:
for i := 0 to Form1.ComponentCount - 1 do if Pos('btnMacro', Form1.Components[i].Name) = 1 then TButton(Form1.Components[i]).Name := MacroList[StrToInt(Copy(Form1.Components[i].Name, 9, 2))].Name;
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus