Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Wildcards
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00184614
Message ID:
00184654
Vues:
28
>Thanks Nancy
>
>But wilcards can also include '?' like "_*.?A?"
>
>One way is to save it as a file in an empty directory and use aDir but it's "crude".
>
>Hope someone has the code to detect for all possible combination =).

What about the native LIKE() and LIKEC() functions in VFP, which uses exactly the same wildcarding conventions as the DOS file wildcards? For example:

IF LIKE("_*.?A?",cFilenameToTest)
* the wildcard matches up
ENDIF


LIKEC() works in a similar fashion but supports double-byte character formats.

>
>
>>Is it always the filename portion that you are wildcarding?
>>
>>
cStr = '*' + SUBSTR( cFileName, at('.', cFileName ) )
>>IF ATC( cStr, cWildCardStr ) > 0
>>  *!* then it's there
>>ELSE
>>  *!* then it's not
>>ENDIF
>>
>>>Need a way to determine if a filename is a member of a set of wildcards
>>>
>>>ie
>>>sample.dbf is a member of "*.dbf,*.cdx"
>>>sample.old is not a member of "*.dbf,*.cdx"
>>>
>>>Thanks
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