private
fint:integer;procedure testproc(value:integer);
begin
 fint:=value;
end;
button click;
begin
 testproc;
end;
delphi报错要赋参数
但如果
pulished
property myint integer read fint write testproc;
编译通过.
请问是什么原因.

解决方案 »

  1.   

    类的属性可访问类的私有变量procedure testproc(value:integer);//这是个外部过程
    不是类的过程,改为Tfrom1.testproc(value:integer)即可
      

  2.   

    Private
    protected
    published
    public
      

  3.   

    访问级别我知道.
    var i:integer;
    begin
    i:=88;
    testproc(i);
    end;
    这是正确的.
    pulished
    property myint integer read fint write testproc;
    问题是一个要testproc(i)一个是testproc;为什么
      

  4.   

    to westfly
    说详细点好吗
      

  5.   

    同意Westfly,
    testproc(i),他是一个语句,必须有函数名和参数!
    而在定义属性的时候,testproc只是一个地址,既当写属性的时候,就去读这个地址!