What value will the function return?

What value will the function return?

program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses SysUtils;

function TestValue(CheckInt: Integer): Integer;
begin
Result := 0;
try
if CheckInt = 1000 then
Exit;
finally
Result := CheckInt
end;
end;

begin
Writeln(TestValue(1000));
Readln;
end.

Unlike all previous versions, Delphi 10.2 shows the hint: H2077 Value assigned to 'TestValue' never used.

Comments

  1. I'd be encouraged if they would fix the floating point problems. For instance that Set8087CW isn't threadsafe. A 20+ year old bug.

    ReplyDelete
  2. David Heffernan love how you made problems plural. A sigh from a graphics guy living in a bankers world. I am thrilled with the excess precision control though. Progress (perhaps truncated a bit)

    ReplyDelete
  3. That was an example of the many problems.

    ReplyDelete

Post a Comment