Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Microsoft's position on Visual FoxPro and .NET
Message
From
14/06/2004 10:09:19
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
 
 
To
14/06/2004 09:53:41
Emmanuel Huybrechts
Technimeca International Corp.
Montréal, Quebec, Canada
General information
Forum:
Visual FoxPro
Category:
Conferences & events
Miscellaneous
Thread ID:
00908177
Message ID:
00913443
Views:
74
>Overloaded method are not so bad. For one thing, it can lead to more elegant code because you can have different code for a different list of parameters. And thus, you don't have to write lines like this :
I didn't say that so bad. Only I said I don't needed in in VFP. Usually overloaded methods do some in most situations, so at worst in VFP you have to write a case or if in first lines like in your sample.

>
>FUNCTION Test(Param1, Param2)
>DO CASE
>CASE PCOUNT() == 1
>   ** do this
>CASE PCOUNT() == 2
>   ** do that
>ENDCASE
>
>
>with overloaded methods, you can write :
>
>FUNCTION Test(Param1)
>  ** do this
>ENDFUNC
>
>FUNCTION Test(Param1, Param2)
>  ** do that
>ENDFUNC
>
>


What is the different? I can't see. But in vfp I can do that:
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform