Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Easy one But I forgot. If n = 0, or n = 1
Message
De
10/06/2013 22:40:07
 
 
À
10/06/2013 22:05:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01575918
Message ID:
01575973
Vues:
60
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform