type
    TTest=class
     private
            FSZ:Array of Array of String;
     public 
            procedure SetSZ(index:Integer);
            Function  GetSZ(index:Integer;const value:String);
            property SZ[index:Integer] read GetSZ write SetSZ;//*
end;//*我不知道这样行不行,反正如果FSZ这样声明 FSZ:Array of String;应该可以,
请问声明一个属性它的类型为多维数组时,应该怎样写了!

解决方案 »

  1.   

    type
        TTest=class
         private
                FSZ:Array of Array of String;
         public 
                procedure SetSZ(index:Integer; value: String);
                Function  GetSZ(index:Integer): string;
                property SZ[index:Integer] read GetSZ write SetSZ;//*
    end;
      

  2.   

    GET

    SET
    方法的参数列反了..还有, SZ必须标明是什么类型的?TTest=class
         private
                FSZ:Array of Array of String;
                procedure SetSZ(index:Integer; value: String);
                Function  GetSZ(index:Integer): string;            
         public 
                property SZ[index: Integer]: String read GetSZ write SetSZ;//*
    end;在这方面, DELPHI有一个方法可以自动生成的:
    先输入property SZ[index: Integer]: String;
    在把光标移到这一行上, 点击鼠标右键, 在弹出的菜单中选择"Complete class at cursor"
    项即可以生成其它的代码. 也可以按"CTRL + SHIFT + C"键