过程为:
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.

解决方案 »

  1.   

    这个工程是初始化进程用的啊
    你最好贴出所有代码,那个地方出错,很可能是在FORM.ONSHOW或者ONCREATE事件中出错的
      

  2.   

    unit Unit1;interfaceuses
      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.
      

  3.   

    arrbycol();  arrbyRow(); 应该声明在调用之前吧!   
      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下面吧!
    我没仔细看,其它人认为如何?
      

  4.   

    当你的i=0时 你的shapearr[1]并未创建 所以出错了
      

  5.   

    还是不行,出现的问题如下
    谢谢你们的解答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.
      

  6.   

    to:hstod()
    这是个问题,竟然这个问题没有报错,奇怪
    谢谢你,问题依旧
      

  7.   

    你设定一个断点啊,看看什么地方出错,应该是在CREATE的地方错了
      

  8.   

    当调用arrbycol(1);    时,shapeArr[0]创建了,但是
    shapeArr[1]--shapeArr[6],没有创建,你却在
    for j:=1 to 6 do
      begin
        shapearr[j*colNo].Left:=200;
      end;
    这里使用了,所以报错!!
      

  9.   

    to:liuziwei_china(liuziwei)
    谢谢!我好糊涂,不仔细看