<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Arial,Helvetica,sans-serif'>
Hi,<br /><br />I have a problem with overloaded functions. I defined these functions:<br />function val_(name: string): string;<br />function val_(name: string): boolean;<br />function val_(name: string): integer;<br />function val_(name: string): double;<br /><br />var<br /> res: boolean;<br />begin<br /> res := val_(option_variable);<br />end;<br /><br />I get the following error: Error: Incompatible types: got "ShortString" expected "Boolean". So for some reason the compiler is looking at the first function. The mode is objfpc and I turned ansistrings off. I tested by adding the overload modifier but without result. What else could I try or do? Or is overloading only allowed for different parameter lists?<br /><br />Rgds, Darius<br />
</body></html>