Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INLIST() with variable?
Message
De
23/08/1999 15:12:22
 
 
À
23/08/1999 13:13:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00256667
Message ID:
00256739
Vues:
22
>site = 'HSC'
>This works:
>?inlist(site,'xxx','HSC') && returns .T.
>
>This does NOT work:
>clist = "'xxx','HSC'"
>?inlist(site,clist) && returns .F.
>
>I need to have a dynamic list (e.g. clist = ...) so that
>I can use this code to conditionally delete records. Not
>sure why this will not work.
>
>Any ideas or alternative solutions?

You'd need to encapsulate the strings in quotes and macro-expand to extract them, sothing like:

clist = "'xxx','HSC'"
? inlist(site, &clist)

You'll run into problems with the construct if you need to embed quotes inside, so a bit of care is needed in planning the list.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform