Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Easy one But I forgot. If n = 0, or n = 1
Message
From
10/06/2013 22:40:07
 
 
To
10/06/2013 22:05:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01575918
Message ID:
01575973
Views:
61
>Between is fine if you actually want a range, but if you want to match the exact values the you want Inlist instead.
>
If InList(n, 1, 2, 3) Then
>   ...
>EndIf
>In the case of the example, the one you'd choose would depend on whether you are happy matching a range, in which case in Between, or an exact list of values, in which case you'd use InList.
>
>Ian Simcock.


Using inlist() also can have documentation side-effects, as you are explicitly listing an array of values which are expected, indicating solid integers, for example, and only of the ones listed. Using between() is a little more ambiguous.
Previous
Reply
Map
View

Click here to load this message in the networking platform