Z
zzzh
Unregistered / Unconfirmed
GUEST, unregistred user!
各位大侠好!
我是一名围棋爱好者,最近想用Delphi写一个围棋程序,代码如下:
unit Unit1;
interface
.....
var
Point: array[1..19] of array[1..19] of TPoint;
.....
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
var
i,j: Integer;
begin
for i:= 1 to 19 do
begin
for j:= 1 to 19 do
begin
Point[i,j].x:= 10+(i-1)*20;
Point[i,j].y:= 10+(j-1)*20;
end;
end;
end;
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
i,j: Integer;
begin
for i:= 1 to 19 do
begin
for j:= 1 to 19 do
begin
??? if X>(Point[i,j].x-10) and X<(Point[i,j].x+10)
and Y>(Point[i,j].y-10) and Y<(Point[i,j].y+10) then ???
begin
......
但运行时,系统说???间语句为Incompatible types,我百思不得其解,它们不都是Integer类型吗?
请各位大侠指教。小弟在此先谢过了。
致
礼!
zh
wxzhuhua@wx88.net
我是一名围棋爱好者,最近想用Delphi写一个围棋程序,代码如下:
unit Unit1;
interface
.....
var
Point: array[1..19] of array[1..19] of TPoint;
.....
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
var
i,j: Integer;
begin
for i:= 1 to 19 do
begin
for j:= 1 to 19 do
begin
Point[i,j].x:= 10+(i-1)*20;
Point[i,j].y:= 10+(j-1)*20;
end;
end;
end;
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
i,j: Integer;
begin
for i:= 1 to 19 do
begin
for j:= 1 to 19 do
begin
??? if X>(Point[i,j].x-10) and X<(Point[i,j].x+10)
and Y>(Point[i,j].y-10) and Y<(Point[i,j].y+10) then ???
begin
......
但运行时,系统说???间语句为Incompatible types,我百思不得其解,它们不都是Integer类型吗?
请各位大侠指教。小弟在此先谢过了。
致
礼!
zh
wxzhuhua@wx88.net