Как в Delphi исправить ошибку "for loop control variable must be simple local variable"?
Ошибка:
for loop control variable must be simple local variable delphi
Код:
var
y,a,x,xn: real;
i:byte;
begin
a:=strtofloat(edit1.Text);
x:=strtofloat(edit2.Text);
x:=xn+x;
memo1.lines.add('x y');
for x := 0.8 to 2 do;
begin
if x<1.3 then
y:=pi*sqr(x)-7/sqr(x)
else if x=1.3 then
y:=a*power(x,3)+7*sqrt(x)
else if x>1.3 then
y:=ln(x+7*sqrt(x));
memo1.lines.add(floattostrf(x,fffixed,8,3)+''+floattostrf(y,fffixed,8,3)+'');
Источник: Stack Overflow на русском