可以在你的类中定义一个函数,参数为一个Fields,实现成员的赋值,然后就可以使用其为你的类整体赋值了

解决方案 »

  1.   

    实体类中申明
    demoClass=TClass(xxx)
     private
          adoData: _Recordset       ...
     end;
    赋值
     tmpclass.adoData:=DBSource.DataSet.Recordset;
      

  2.   

    定义有参数的构造函数:(参数为一个Fields)
    tmpclass的变量名还是取不出来!!
    怎样写?(100分)
      

  3.   

    可以把你的strID strType 定义成数组啊另:你的strID strType 怎么是private类型的?
    应该是public吧
      

  4.   

    type
    demoClass=TClass(xxx)
     private
          strID : string;
          strType : String;
          
          procedure setID(strID:string);virtual;{$IFNDEF xLIB}abstract;{$ENDIF}
          function getID():string;virtual;{$IFNDEF xLIB}abstract;{$ENDIF}
          procedure setType(strType:string);virtual;{$IFNDEF xLIB}abstract;{$ENDIF}
          function getType():string;virtual;{$IFNDEF xLIB}abstract;{$ENDIF}   published
          property xID:string read getId write setId;
          property xType:string read getType write setType;
      

  5.   

    get class var name is very difficult
    a way:
    define var as point type.我不报希望了。