A common condition that all programs should do is to check if variables are assigned or not.
Take the below statements:
(1)
if Assigned(Ptr) then
begin
// do something
end;
(2)
if Ptr <> nil then
begin
// do something
end;
What is the difference between Assigned(Ptr)
and Ptr <> nil
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…