type
  TShenQingDanForm1 = class(TForm)
    Image1: TImage;
    Label2: TLabel;public
   
 Ptypeid: array[1..8] of string;
    UnitRate1:array[1..8] of real;end;
//这条语句写在那才能实现
  Const
    GridNum:integer=50;//如下的定义呢??? Ptypeid: array[1..GridNum] of string;
    UnitRate1:array[1..GridNum] of real;

解决方案 »

  1.   

    const GridNum=50;//不用:integer
    type
      TShenQingDanForm1 = class(TForm)
        Image1: TImage;
        Label2: TLabel;public
       
     Ptypeid: array[1..GridNum] of string;
        UnitRate1:array[1..GridNum] of real;end;
      

  2.   

    TShenQingDanForm1 = class(TForm)
      public
        class function GridNum: Integer;
      end;class function TShenQingDanForm1.GridNum: Integer;
    begin
      Result := 50;
    end;————————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    ————————————————————————————————————
      

  3.   

    const GridNum=50;type
      TShenQingDanForm1 = class(TForm)
      ……  end;这样就行了
      

  4.   

    为什么加integer就不可以呢?我在别的地方就可以!!!
      

  5.   

    Const
      cGridNum1 :integer=50;
      cgridnum2 =50;
    var 
      gGridNum :integer=50;
    其它单元调用这个常量只要在INTERFACE处uses此单元就可以了...