if N1.Caption =S1 then
begin
N1.Caption :=s2;
timer1.Enabled :=false;
end;
////执行完上面的代码后,N1.Caption 为s2
if N1.Caption =S2 then //以下代码肯定执行.因为有上面的N1.Caption :=s2;
begin
N1.caption:=S1;
timer1.Enabled :=true;
end;
//最后,你赋值N1.caption:=S1; 当然又显示s1的值了
如果你设置断点,就知道N1。CAPTION变了,不过没断点,变得那么快,你当然就看不出了
begin
N1.Caption :=s2;
timer1.Enabled :=false;
end;
////执行完上面的代码后,N1.Caption 为s2
if N1.Caption =S2 then //以下代码肯定执行.因为有上面的N1.Caption :=s2;
begin
N1.caption:=S1;
timer1.Enabled :=true;
end;
//最后,你赋值N1.caption:=S1; 当然又显示s1的值了
如果你设置断点,就知道N1。CAPTION变了,不过没断点,变得那么快,你当然就看不出了
ni.caption 以变为s2了。
if N1.Caption =S1 then
begin
N1.Caption :=s2;
timer1.Enabled :=false;
exit;//退出
end;还是没有用
begin
N1.Caption :=s2;
timer1.Enabled :=false;
Exit;
end;
if N1.Caption =S2 then
begin
N1.caption:=S1;
timer1.Enabled :=true;
end;