chronozphere
15-12-2007, 05:44 PM
Hi fellow programmers 8)
I have a small question. What is the default return value for a function??
I often see the "Return value of function ***** might be undefined". So what happens when it is undiefined? Do i get random data, or is it set to zero?
If it is possible, i would like to compile my code in such a way that all functions return 0 or NIL by default. I don't like doing this:
function SomeFunction: integer;
begin
//just to make sure, SomeFunction has a valid return value
Result := 0;
//lots of code
end;
It would save a lot of code, if i could assume that every function returns 0 by default.
Any tips?? compiler options maybe??
Thanx
I have a small question. What is the default return value for a function??
I often see the "Return value of function ***** might be undefined". So what happens when it is undiefined? Do i get random data, or is it set to zero?
If it is possible, i would like to compile my code in such a way that all functions return 0 or NIL by default. I don't like doing this:
function SomeFunction: integer;
begin
//just to make sure, SomeFunction has a valid return value
Result := 0;
//lots of code
end;
It would save a lot of code, if i could assume that every function returns 0 by default.
Any tips?? compiler options maybe??
Thanx