现在的问题是调用过程时出错。过程ky是为了悔棋。w,x是全局变量。表示单击的行号和列号。
提示:Invalid use of keyword.
Token :form
Line Number:1.
代码:
k:='"d:/aaa/biao/qingling.db"';
query1.RequestLive :=true;
query1.Close ;
query1.SQL.Clear ;
query1.SQL.Add('delete form "d:/aaa/biao/qingling.db"');
query1.ExecSQL ;
{table1.TableName:=k;
table1.open;
table1.last;
if not table1.isempty then
table1.delete; }
ky(w,x);
ky过程如下:
procedure ky(m,n:integer);
var
s:integer;
begin
s:=0;
c[m,n]:=c[m,n]+1;
if (c[m,n]=-1)then c[m,n]:=3;
if (m>1) then
begin
c[m-1,n]:=c[m-1,n]+1;
if (c[m-1,n]=-1)then c[m-1,n]:=3;
end;
if (n>1) then
begin
c[m,n-1]:=c[m,n-1]+1;
if (c[m,n-1]=-1) then c[m,n-1]:=3;
end;
if (m<6) then
begin
c[m+1,n]:=c[m+1,n]+1;
if (c[m+1,n]=-1)then c[m+1,n]:=3;
end;
if (n<6) then
begin
c[m,n+1]:=c[m,n+1]+1;
if (c[m,n+1]=-1)then c[m,n+1]:=3;
end;
kz; //把所做的改变显示在按钮的caption上。
for m:=1 to 6 do
for n:=1 to 6 do
s:=s+c[m,n];
if (s=0) then
showmessage ('成功了!') ;
end;