Of course.... Thanks Cobines!

I have never used the function name instead of "Result", but of course you can. Using () after a function to me seems so C-like and un-Pascallish but it works.

But it is things like this that trip up people coming from Delphi, I guess. Isn't this a potential improvement to the compiler though: scan for overloaded functions before assuming that it is the result value (like Delphi does)? (Or warn about overloaded functions without parameters, similar to mode objfpc disallowing parameter names that are the same as methods?)

On 2010/01/31 09:46 AM, cobines wrote:
Isn't the "GetValue_overloaded" in

   1: Result:=GetValue_overloaded

the return value of the function?

Maybe you should call it this way:

Result:= GetValue_overloaded()

That's why I think you get the warning.

The reason you might be getting random results is that the return
value has not been initialized.


_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to