Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Defaulting parameter to null
Message
From
19/09/2019 18:34:54
 
 
To
19/09/2019 17:45:43
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01670958
Message ID:
01670976
Views:
64
>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 ;-)
Previous
Reply
Map
View

Click here to load this message in the networking platform