我已经在procedure外面定义了一个全程数组
var tag:array [0..18,0..18] of integer;
为什么我在procedure里面调用tag的时候还会提示 array type required
var tag:array [0..18,0..18] of integer;
为什么我在procedure里面调用tag的时候还会提示 array type required
解决方案 »
- delphi中能不能按个按钮来拷贝文件:
- delphi如果从数据库读去图片,我做了整天都没做出来。
- 急,请教tquickrep打印控件的使用?
- 关于记录集问题
- cannot create form.No MDI forms are currently active.
- "not found xxx.dcu"如何处理?新手~_^
- 新手求教李维老师书中所说“避免CloneCursor+SQL语句产生重复数据”的方法
- delphi下如何将十六进制转化成ASC字符串,最后三位为小数.00,1234---"12.34",固定两位小数
- 如何将一字符串中的回车键符号换成字符串???
- 帮我解决一个小问题?如何?
- 关于LED显示
- 窗体设计
i:integer=2;
Form1: TForm1;
tag:array [0..18,0..18] of integer;
iblack:boolean;
implementation{$R *.dfm}procedure TForm1.DrawGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
drawgrid1.Canvas.Pen.Color:=clwhite;
drawgrid1.Canvas.brush.Color:=clwhite;
drawgrid1.Canvas.Ellipse(acol*21,arow*21,(acol+1)*21,(arow+1)*21);
if tag[acol,arow]=1 then
drawgrid1.Canvas.Ellipse(acol*21,arow*21,(acol+1)*21,(arow+1)*21)
else if tag[acol,arow]=2 then
drawgrid1.Canvas.arc(acol*21,arow*21,(acol+1)*21,(arow+1)*21,(acol+1)*21,(arow+1)*21,(acol+1)*21,(arow+1)*21);;
end;
procedure TForm1.DrawGrid1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var col,row:integer;begin
drawgrid1.Canvas.Pen.Color:=clBlack;
drawgrid1.Canvas.brush.Color:=clBlack;
drawgrid1.mousetocell(x,y,col,row);
if tag[col,row]=0 then
begin
if iblack then
tag[col,row]:=1
else tag[col,row]:=2
end;
iblack:=not iblack;
end;end.上面代码中,凡是调用tag的地方,都会提示array type required
换个名字就ok
比如name等等,都是系统保留字
定义变量不要和这些重复。