Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Microsoft's position on Visual FoxPro and .NET
Message
De
14/06/2004 10:18:03
Emmanuel Huybrechts
Technimeca International Corp.
Montréal, Québec, Canada
 
 
À
14/06/2004 10:09:19
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Conférences & événements
Divers
Thread ID:
00908177
Message ID:
00913447
Vues:
75
>>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.


Not really, and it seems much less elegant to me than :
FUNCTION Test(Param1)
RETURN Param1

FUNCTION Test(Param1, Param2)
RETURN Param1+Param2
Your 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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform