This is propably a noob question but googling around did not help me:
I have to parse a text file with one line. The line contains a comma separated list of values and each value has to be stored into a new variable.
So what I am looking for is a for loop that reads out a value, created a new variable and assign it. So something in this form:
posPrevInt:= 0;
counterInt:= 1;
for i:= 1 to 16 do
begin
posCurrInt:= Pos(',', ReadString, posPrevInt);
DummyString:= Copy(ReadLine, posPrevInt, posCurrInt- posPrevInt);
if not TryStrToFloat(DummyString, Gain1) then
exit;
posCommaPrev:= posCommaCurr;
inc(counterInt);
end;
Instead of "Gain1" I want to assign the variables Gain1, then Gain2, then Gain3,...
So is there a way to declare the variable name using a number like "Gain+posPrevInt:= " or having the variables in an array to access them?