pos := IntToStr(comp1[5]);
with TLabel (FindComponent('Labelc'+pos)) do Caption:=comp1n;
with TLabel (FindComponent('Labelc'+pos+'w')) do Caption:=IntToStr(comp1[1]);
with TLabel (FindComponent('Labelc'+pos+'l')) do Caption:=IntToStr(comp1[2]);
with TLabel (FindComponent('Labelc'+pos+'d')) do Caption:=IntToStr(comp1[3]);
with TLabel (FindComponent('Labelc'+pos+'s')) do Caption:=IntToStr(comp1[4]);
pos := IntToStr(comp2[5]);
with TLabel (FindComponent('Labelc'+pos)) do Caption:=comp2n;
with TLabel (FindComponent('Labelc'+pos+'w')) do Caption:=IntToStr(comp2[1]);
with TLabel (FindComponent('Labelc'+pos+'l')) do Caption:=IntToStr(comp2[2]);
with TLabel (FindComponent('Labelc'+pos+'d')) do Caption:=IntToStr(comp2[3]);
with TLabel (FindComponent('Labelc'+pos+'s')) do Caption:=IntToStr(comp2[4]);
pos := IntToStr(comp3[5]);
with TLabel (FindComponent('Labelc'+pos)) do Caption:=comp3n;
with TLabel (FindComponent('Labelc'+pos+'w')) do Caption:=IntToStr(comp3[1]);
with TLabel (FindComponent('Labelc'+pos+'l')) do Caption:=IntToStr(comp3[2]);
with TLabel (FindComponent('Labelc'+pos+'d')) do Caption:=IntToStr(comp3[3]);
with TLabel (FindComponent('Labelc'+pos+'s')) do Caption:=IntToStr(comp3[4]);
...
and so on to the 10th. i was looking for something like FindComponent function but for the variables, so i can put one piece of code into for loop, but it seems like in pascal you cant concatenate string into variable names. all i need is to somehow dynamically change variable names so there is no need to write this code 10 times with the only thing changing is comp1,comp2,comp3,... comp1n, comp2n, comp3n, and so on...
any tips please? i would really appreciate! (sorry for bad english)