Due to a bug in my code I stumbled upon this scenario by accident: -
function Bogus: string;
begin
end;
var
s: string;
begin
s:='Original value';
s:=Bogus;
MessageDlg(s, mtInformation, [mbOK], 0);
end.
Will show a dialog of Original value
where the non-result of my function call has no effect on my var; I would have expected it to be empty.
Is this the expected behaviour? Can it be relied upon? Would anyone actually implement this on purpose??!?
I've been using Delphi since 1995 and have never encountered this before.
(Even to this day I still won't select text from the cursor placed by the IDE on a compile error as that used to crash Delphi 1.0!!!)