Hmm how 'bout this one:
It does roughly the same as your example. Perhaps not so flexible, but less code.Code:procedure renameAllLabels(); var i : byte; begin for i := 0 to ComponentCount - 1 do if Components[i] is TLabel then (Components[i] as TLabel).caption := 'Hello'; end;
Bookmarks