>>FUNCTION Test(Param1, Param2) >>DO CASE >>CASE PCOUNT() == 1 >> ** do this >>CASE PCOUNT() == 2 >> ** do that >>ENDCASE >>>>
>>FUNCTION Test(Param1) >> ** do this >>ENDFUNC >> >>FUNCTION Test(Param1, Param2) >> ** do that >>ENDFUNC >>>>
>FUNCTION Test(Param1, Param2) > if PCOUNT()== 2 > param2=iif(type("param1")="C","",0) > endif >return param1+param2 >> Look at that. Code lines fewer from a overloaded method.
FUNCTION Test(Param1) RETURN Param1 FUNCTION Test(Param1, Param2) RETURN Param1+Param2Your code is the kind of code that is making OOP "experts" going away from VFP. They will say VFP is not a serious language, it's almost as bad as Basic.