Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defaulting parameter to null
Message
De
19/09/2019 18:34:54
 
 
À
19/09/2019 17:45:43
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01670958
Message ID:
01670976
Vues:
63
>You can do that indirectly without using pcount() or parameters() (I seldom use them). When you don't pass a parameter, by "default" it is boolean false or simply empty() - in VFP .F. is empty.
>Thus you could do this:
>
>
>parameters tuSomeParameter
>*tuSomeParameter = evl(m.tuSomeParameter, < valueYouwantAsDeafult >)
>tuSomeParameter = evl(m.tuSomeParameter, .null.)
>
Definately workable, but I'd switch the parameter datatype to something different from boolean and check type() or better iif(vartype()==...., , )

Personal preference - bordering on "beauty in the eye of beholder"
and no attempt to start another long discussion ;-)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform