代码一:
TMyobject=class
  private
    SomeValue:integer;
    procedure SetSomeValue(AValue:Integer);
  public
    property value: Integer read SomeValue write SetSomeValue ;
  end ;
  procedure TMyobject.SetSomeValue(AValue:Integer)
   begin
     if SomeValue<>AValue then 
       SomeValue:=AValue;
   end;
代码二:
TMyobject=class
  private
    SomeValue:integer;
    procedure SetSomeValue(AValue:Integer);
  published
    property value: Integer read SomeValue write SetSomeValue ;
  end ;
  procedure TMyobject.SetSomeValue(AValue:Integer)
   begin
     if SomeValue<>AValue then 
       SomeValue:=AValue;
   end;
还有property value: Integer read SomeValue write SetSomeValue ;这段是怎么运行的?

解决方案 »

  1.   

    代码1中的Value是动态属性(也即只能在运行时进行设置),而代码2中的Value是可视属性(即可以在设计时也可以在运行时进行设置)。
      

  2.   

    还有property value: Integer read SomeValue write SetSomeValue ;这段是怎么运行的?这是Delphi的运行机制,指得是读取时通过SomeValue来获取,进行设置时是通过SetSomeValue过程来实现的。
      

  3.   

    问的是published和Public两个关键字的区别吧!
    一个是全局可见
    一个是设计期可以看得到 发布发来的 选中这个对象 按F11就可以在属性列表中找到
      

  4.   

    公布的属性在Object Inspector中是可以看到的!不过二者都是动态属性,在运行期可以进行设置,但第二个在编辑期也可以直接在Object Inspector直接进行设置,而第一个却不可以!
      

  5.   

    就是一个能生成RTTI一个不能了。—————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    —————————————————————————————————
      

  6.   

    To Linux2001  没有办法,以权谋私!