我有一个正在使用的VCL Delphi应用程序,但是Delphi似乎拒绝执行我的一些代码行,而DrawLine是一个私有函数...
if not(FirstCoords) then
begin
firstcoords := true;
xCo1 := xCoPre + LeftOffset;
yCo1 := yCoPre + TopOffset;
end
else
begin
xCo2 := xCoPre + LeftOffset;
yCo2 := yCoPre + TopOffset;
DrawLine(xCo1,xCo2,yCo1,yCo2);
bbtFieldScale.Click;
end;
当我逐步调试时,它将执行If,然后继续将“ firstcoords”设置为true,但是然后直接跳到If的末尾,甚至不碰其他两行...如果我添加一行如下面的代码,那么它似乎执行了代码...
if not(FirstCoords) then
begin
firstcoords := true;
xCo1 := xCoPre + LeftOffset;
yCo1 := yCoPre + TopOffset;
showmessage(inttostr(xCo1+yCo1));
end
else
begin
xCo2 := xCoPre + LeftOffset;
yCo2 := yCoPre + TopOffset;
DrawLine(xCo1,yCo2);
bbtFieldScale.Click;
end;
请帮助,我将非常感激:)
我已禁用优化,但它似乎仍然拒绝...