教程-Delphi中比较两个对象是否一致及地址是否相同

资料说明:

1.http://blog.csdn.net/diligentcatrich/article/details/7077294

 

说明:

 

实例代码:

 1 procedure TForm1.btn1Click(Sender: TObject);
 2 var
 3   p1: Pointer;
 4   p2: Pointer;
 5 begin
 6   if TObject(btn1) = TObject(btn2) then
 7     ShowMessage('The same as')
 8   else 
 9     ShowMessage('Dfferent');
10   p1 := @btn1;
11   P2 := @btn2;
12   if p1 = p2 then 
13     ShowMessage('The same as')
14   else 
15     ShowMessage('Dfferent');
16 end;

  

备注:

 

posted on 2017-08-03 11:31  疯狂delphi  阅读(559)  评论(0编辑  收藏  举报

导航