在以下代码中测试了哪个Ready
实例,为什么?
interface
type
TObject1 = class
...
public
property Ready: boolean read FReady write FReady;
end;
TObject2 = class
...
public
property Ready: boolean read FReady write FReady;
end;
implementation
var
Object1: TObject1;
Object2: TObject2;
...
procedure test;
var
Ready: boolean;
begin
Ready:= true;
with Object1, Object2 do begin
if Ready then ShowMessage('which one?');
end; {with}
end;
答案 0 :(得分:13)
最后一个。
with Object1, Object2 do
相当于
with Object1 do
with Object2 do
所以Object2
将成为第一优先。