Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INLIST syntax
Message
De
07/02/1997 22:18:52
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00019640
Message ID:
00019667
Vues:
38
>>>>I have a TEST field which contains something like 1,2,5,18,23,32,33,34.
>>>>
>>>>I would like to compare a value within this field value.
>>>>
>>>>For example, I would like to do something like
>>>>
>>>>IF INLIST(TEST,'23')
>>>> ...
>>>>ENDIF
>>>>
>>>>But, this is not working. How can I process this validation?
>>>
>>>if ",23," $ ","+alltrim( TEST)+","
>>>...
>>>
>>>This the best way I know. Please note that it's very important to add commas before and after TEST (otherwise you can find 23 in 423 for example even if 23 is not there). A good idea is to keep ",1,2,5,18,23,32,33,34," in TEST, not "1,2,5,18,23,32,33,34". It's faster.
>>
>>That will work but not if 23 is at the beginning or at the end.
>
>Sure it will work. Vlad put the necessary "," at both the beginning and end of the string. If they're already in the string, no harm done.

Thanks.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform