Scott Moore wrote:
Back on the original subject, the spec for Borlands version of overloads are just awful. Virtually any difference in type between overload parameter lists is accepted as a valid overload. For example, two subranges of integer are accepted, which is clearly an ambiguous overload. Borland "resolves" this by calling the procedure or function with the smallest integer range.
I am not sure that this is entirely correct. What Delphi does is this: "In these cases, when it is possible to do so without ambiguity, the compiler invokes the routine whose parameters are of the type with the smallest range that accommodates the actual parameters in the call".
I don't think that this is the same thing as what you said.
That being said, I am not sure why one would want to overload routines using different subranges of integer. Just because the compiler allows something doesn't mean that one should do it, especially seeing that, in such cases, one single routine (taking a parameter of the largest size of integer) would do just fine.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/