1 comments. Current rating: (1 votes). Leave comments and/ or rate it.
Question:
I seem to be getting a bogus warning about an undefined function result. Can anyone confirm this?
Answer:
Both Delphi 5 and Delphi 6 will report:
Return value of function Undefined2 might be undefined
Delphi 7 will complain about Undefined1 as well.
Return value of function Undefined1 might be undefined
Return value of function Undefined2 might be undefined
This is a bug in Delphi 7.
program Project1;
function Undefined1 : boolean;
var
b: boolean;
begin{ Undefined1 }
Undefined1 := False;
b := True;
if b then
Undefined1 := True
end; { Undefined1 }function Undefined2 : boolean;
var
b: boolean;
begin{ Undefined2 }
b := True;
if b then
Undefined2 := True
end; { Undefined2 }beginend.
You don't like the formatting? Check out SourceCoder then!
Content-type: text/html
Send a message to
Subject
Comments:
2006-08-01, 06:33:25
[hidden] from France
I got the same problem with strings
function myFunction(...) : String;
begin
Result := EmptyStr;
// some initialization stuff
try
try
// lot of stuff, not dealing with Result
except
on E:Exception do
Result := E.Message;
end;
finally
// finalization stuff, not dealing with Result
end;
end;