[fpc-pascal] How to solve "variable does not seem to be initialized" compiler hint.
florian at freepascal.org
Thu Nov 19 20:29:01 CET 2009
Vinzent Höfler schrieb:
> Florian Klaempfl <florian at freepascal.org>:
>> Out is not made to solve such problems but plainly to work with
> Really? Well, that's not what the FPC manual says:
And? Is there a different reason written? And even if it is:
documentation writer know less than implementors :)
> -- 8< --
> The purpose of an out parameter is to pass values back to the calling routine: The variable is passed by reference. The initial value of the parameter on function entry is discarded, and should not be used.
> If a variable must be used to pass a value to a function and retrieve data from the function, then a variable parameter must be used. If only a value must be retrieved, a out parameter can be used.
> -- 8< --
> So having the semantic difference between "var" and "out" and thus the differentiation between uninitialized and (pre)initialized parameters is merely a random achievement?
More information about the fpc-pascal