Default Parameters and Overloaded Functions
If you use default parameter values in an overloaded routine, avoid ambiguous parameter signatures. Consider, for
example, the following.
procedure Confused(I: Integer); overload;
...
procedure Confused(I: Integer; J: Integer = 0); overload;
...
Confused(X); // Which procedure is called?
In fact, neither procedure is called. This code generates a compilation error.
126
Default Parameters in Forward and Interface Declarations
If a routine has a forward declaration or appears in the interface section of a unit, default parameter valuesif there
are anymust be specified in the forward or interface declaration. In this case, the default values can be omitted from
the defining (implementation) declaration; but if the defining declaration includes default values, they must match
those in the forward or interface declaration exactly.
127
|