Tabc = class(TCustomControl)
private
{ Private declarations }
ra:integer;
procedure rb(value:integer); protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
property testvalue:integer read ra write rb; //这个语句怎么理解啊
属性,读和写是怎么理解啊。属性编辑窗中先是....显示的是 谁的值 ? end;procedure Register;implementation
procedure Tabc.rb(value:integer);
begin
if ra<>value then
begin
showmessage('value'+inttostr(value));
showmessage('testvalue'+inttostr(testvalue));
ra:=value;
showmessage('ra'+inttostr(ra));
end;
end;
private
{ Private declarations }
ra:integer;
procedure rb(value:integer); protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
property testvalue:integer read ra write rb; //这个语句怎么理解啊
属性,读和写是怎么理解啊。属性编辑窗中先是....显示的是 谁的值 ? end;procedure Register;implementation
procedure Tabc.rb(value:integer);
begin
if ra<>value then
begin
showmessage('value'+inttostr(value));
showmessage('testvalue'+inttostr(testvalue));
ra:=value;
showmessage('ra'+inttostr(ra));
end;
end;
解决方案 »
- 用delphi7加载spcomm.pas时候出现的错误 在线等结果
- fastreport3怎样指定打印机
- 询问TWebBrowser多线程的问题
- dbGridEh中,某一字段如何设置成下拉?下拉的内容来源于另外一个表
- 如何检测指定IP是否启动SQL SERVER 服务?
- 初学者问题:我写了一个函数:function StrToRMB(curs :string) :string; 请问如何声明,在哪里声明,如何调用。谢谢!只有30分了
- 关于 TListView 的 ReadOnly 属性(前面我的帖子说反了)
- 请问安装SQL2000的问题。
- 我想把一个文件夹的内容全部备份COPY到另个一个目录里面,怎么做啊?
- 那里有SQL数据库备份的好控件?
- 找工作帖——12月16日 麻烦版主给保留五天,五天后一定结帖
- 除法“/”的用法,急
比如:
var abc:Tabc;
abc.testValue := 1; 这个时候是调用了write手段,也就是:abc.testValue := rb(1);
而如:
var i:Integer;
i := abc.testValue; 这个时候是调用了read手段,也就是:i := ra;
先是在属性编辑器中: testvalue、Read、Write初始化都为0,当输入值时,这时就 Read ra赋给 testvalue.
这时再把testvalue值传给 rb的参数,就执行了 rb方法