delphi 请教下高手
var
i,m,n,k,j:integer;
q:real;
begin
n:=0;
m:=strtoint(edit1.text);
for j=2 to m do
BEGIN
q:=sqrt(m);
k:=trunc(q);
for i=2 to k do
BEGIN
if(j div i=0)then
break;
if(i>=k+1)then
edit2.Text:= edit2.Text+inttostr(j)+',';
end
end
[Error] sushu.pas(37): For loop control variable must be simple local variable
[Error] sushu.pas(38): Expression expected but 'BEGIN' found
[Error] sushu.pas(41): For loop control variable must be simple local variable
[Error] sushu.pas(42): Expression expected but 'BEGIN' found
怎么改啊?