过程为:
procedure ArrByCol(colNo:integer);
var
j:integer;
begin
for j:=1 to 6 do
begin
shapearr[j*colNo].Left:=200;
end;
end;调用为:(编译通过)
ArrByCol(1);不知道为什么一调用会自动生成以下的工程(这个工程是什么,是不是程序运行步骤)
program Project2;uses
Forms,
Unit1 in 'Unit1.pas' {Form1};{$R *.res}begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;'问题出现在这里,不知道怎么回事
end.
procedure ArrByCol(colNo:integer);
var
j:integer;
begin
for j:=1 to 6 do
begin
shapearr[j*colNo].Left:=200;
end;
end;调用为:(编译通过)
ArrByCol(1);不知道为什么一调用会自动生成以下的工程(这个工程是什么,是不是程序运行步骤)
program Project2;uses
Forms,
Unit1 in 'Unit1.pas' {Form1};{$R *.res}begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;'问题出现在这里,不知道怎么回事
end.
解决方案 »
- SQL查询条件如何与数组结合起来??
- 求助:用QReport时,怎样在detail中动态生成TQRLabel?一定给分
- lopatialkey 怎么用?
- 怎样读出dataset中某记录的某字段的值?
- 有没有办法知道DBNavigator控件,按下的是哪个按钮?
- 请问如何才能给pardaox数据加索引
- 关于treeview的右键菜单!
- 这个sql怎么来写??
- 关于Delphi编译的奇怪问题-TDateTimePicker,求解释。
- 如何编程实现访问别的机子不共享目录下的文件
- 在Delphi6.0中,怎样控制报表的行数(如每页只显示8行)?
- 请问如下代码要如何实现,主要是OPENDIALOG的特性
你最好贴出所有代码,那个地方出错,很可能是在FORM.ONSHOW或者ONCREATE事件中出错的
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
Button2: TButton;
procedure fonclick(sender:Tobject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
c:integer=3; labelarr:array[0..3] of Tlabel;
buttonarr:array[0..3] of Tbutton;
shapeArr:array[1..72] of Tshape;
procedure ArrByRow(RowNo:integer);
procedure ArrByCol(ColNo:integer);
implementation{$R *.dfm}procedure TForm1.fonclick(sender:Tobject);
begin
case TButton(sender).tag of
0: showmessage('0');
1: showmessage('1');
end;
showmessage(inttostr(TButton(sender).tag));
labelarr[TButton(sender).tag].Visible:=
not(labelarr[TButton(sender).tag].Visible);
end;procedure TForm1.Button2Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to 12 do
begin
shapeArr[i]:=Tshape.create(application);
shapeArr[i].Parent := Form1 ;
shapeArr[i].Visible:=true;
shapeArr[i].Top:=i*50;
shapeArr[i].Width:=15;
shapeArr[i].Height:=15;
shapeArr[i].Shape:=stCircle;
shapeArr[i].Tag:=i;
//arrbycol(1); //********* 一加上就错??
//arrbyRow(1); //********* 一加上就错 end;
end;procedure ArrByCol(colNo:integer);
var
j:integer;
begin
for j:=1 to 6 do
begin
shapearr[j*colNo].Left:=200;
end;
end;procedure ArrByRow(RowNo:integer);
var
k:integer;
begin
for k:=1 to 6 do
begin
shapearr[k*RowNo].top:=200;
end;
end;
end.
c:integer=3;
labelarr:array[0..3] of Tlabel;
buttonarr:array[0..3] of Tbutton;
shapeArr:array[1..72] of Tshape;
procedure ArrByRow(RowNo:integer);
procedure ArrByCol(ColNo:integer);
上面这些应该声明在implementation下面吧!
我没仔细看,其它人认为如何?
谢谢你们的解答Project Project2.exe raised exception class EAccessViolation with message 'Access violation as address 00431448 in module 'Project.exe'.Read of address 00000048'.Process stoppped,use Step or Run to continue.
这是个问题,竟然这个问题没有报错,奇怪
谢谢你,问题依旧
shapeArr[1]--shapeArr[6],没有创建,你却在
for j:=1 to 6 do
begin
shapearr[j*colNo].Left:=200;
end;
这里使用了,所以报错!!
谢谢!我好糊涂,不仔细看