If I need a lump of code to run if either A or B is true then I would do
if A or B then
begin
dosomething;
end;
But what if A is a really simple calculation (like are two bytes equal) whereas B is really complicated, like maybe even a function that goes and gets an answer from another computer over a network connection.
When the software runs presumably it has to actually calculate A and B before it can decide if (A OR B)=true ?
So I guess that actually if I don't want B to get calculated if A is true then I should do
if A then
begin
if B then
begin
dosomething;
end;
end;
and equally in my first version the function that calls the other computer over the network will ALWAYS do that even if A has already "sealed the deal"?
Is this correct or have I missed something?
thanks