Variants can hold values of any type except records, sets, static arrays, files, classes, class references, and pointers. In other words, variants can hold anything but structured types and pointers
—————————————————————————————————
MaximStr := '宠辱不惊,看庭前花开花落,去留无意;
             毁誉由人,望天上云卷云舒,聚散任风。';
if Not Assigned(I) then
  I := TI.Create(Nil);
I.Maxim := MaximStr;
I.Desire := '加不加分随你';
—————————————————————————————————
       

解决方案 »

  1.   

    何不直接定义
    vValue: TDataSet?
    —————————————————————————————————
    MaximStr := '宠辱不惊,看庭前花开花落,去留无意;
                 毁誉由人,望天上云卷云舒,聚散任风。';
    if Not Assigned(I) then
      I := TI.Create(Nil);
    I.Maxim := MaximStr;
    I.Desire := '加不加分随你';
    —————————————————————————————————
           
      

  2.   

    何不直接:
    vValue: TDataSet?
    —————————————————————————————————
    MaximStr := '宠辱不惊,看庭前花开花落,去留无意;
                 毁誉由人,望天上云卷云舒,聚散任风。';
    if Not Assigned(I) then
      I := TI.Create(Nil);
    I.Maxim := MaximStr;
    I.Desire := '加不加分随你';
    —————————————————————————————————
           
      

  3.   

    同意  
     
    lxpbuaa(桂枝香在故国晚 
      

  4.   

    因为并不知道Component的类型,我又怎么知道他有TDataSet属性呢