1. 注意不要造成死循环,例如:
function TCustomDAConnection.GetConnected: boolean;
begin
Result := Connected;// endless loop, Using Connected equals using GetConnected.
end;
本文通过一个具体的编程示例,介绍了如何避免在代码中出现死循环的问题。通过理解函数调用自身时可能引发的问题,帮助开发者更好地编写高效且无误的代码。
1. 注意不要造成死循环,例如:
function TCustomDAConnection.GetConnected: boolean;
begin
Result := Connected;// endless loop, Using Connected equals using GetConnected.
end;

被折叠的 条评论
为什么被折叠?