Loop variables (Names of Inputfields / Labels)

Hey there!
I have 3 Inputfields and 3Labels and i want to get the value from the InputFields into the aCount with a loop, i something like this…

public InputField InFie1, InFie2, InFie3;
public Text Lbl1, Lbl2, Lbl3;
public int aCount, bCount;

for (int i = 1; i < 4; i++)
{
aCount += Convert.ToInt32(("InFie" + i.ToString()).text);
}

But that is not working and i have literaly no clue how to fix that problem :frowning:
If you have some advices i would be thankful. And excuse my bad english.

Thanks for reading though!

Try putting the Inputfields in an array and then loop in the array and add the value of the Inputfield.

public InputField[] Fields;
public int aCount;

for(int i=0;i<Fields.Length;i++)
{
    aCount += Int.Parse(Fields*.text);*

}