>Hi,
>I have a function that need to have overload feature. Since VFP doesn;t support overload, how could I implement it?
>
>Print(cText, cAlighment)
>Print(cText1, cText2, ....)
AFAIK, the main reason for introducing the overload was to allow the same operation or function to work on different types of operands. Now since VFP doesn't have to use strict typing, you can pass any type of operand as a parameter to a function (or procedure or method), and it will be passed as is, without prior checking. VFP's internal functions check the type of parameters only after they are passed.
So, in a way, we can say VFP already has the overload in functions, procedures, methods (but not in operations).
Now dealing with the unknown type of parameter is the matter of startup code in your function - the usual set of functions like empty(), pcount(), type(), vartype(), isalpha(), isdigit() and such can be used to decide what sort of, and how many parameters were passed.