Saludos caro ahora es que vi tu respuesta muchas gracias y bueno así si creo que servirá pero me sale error que no he declarado el 'ItemIndex', será que tengo que declararlo como variable? y si es así de qué tipo? LongInt o Integer? Gracias de antemano y disculpen la molestía...
Código Delphi
[-]ppe:= 0;
Rpe:= 0;
for i:= 0 to ComponentCount -1 do
if Components[i] is TComboBox then
with TComboBox(Components[i]) do
if Tag in [51..54] then
begin
if ItemIndex <> -1 then
begin
ppe:= ppe + Material[ItemIndex].VPeso;
Rpe:= Rpe + Material[ItemIndex].VResist;
end;
end;
pte:=0;
Rte:=0;
if if Tag in [51..54] then
begin
if ItemIndex <> -1 then
begin
pte:= pte + Material[ItemIndex].VPeso;
Rte:= Rte + Material[ItemIndex].VResist;
end;
end;