Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File skeleton
Message
De
12/05/2005 00:22:37
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
11/05/2005 22:56:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01013253
Message ID:
01013264
Vues:
14
A file skeleton does not have the p ower of a "regular expression". You can use a question mark (?) to replace a single character, and an asterisk (*) for any number of characters.

For more sophisticated handling, I would return too many files (for example, "*.app"), and let VFP analyze whether the filename meets your criteria.

>Hi,
>May I know the file skeleton that able to find these files using ADIR()?
>
>1. MYPREFIX-MYTOPIC.APP

In this example, and the following ones, it is not clear to me what part is a variable, and what part is constant. If it is a constant, just use:

"myprefix-mytopic.app"

for the file skeleton. Assuming (for example) that both "Myprefix" and "MyTopic" are variable,s you could also create a variable for the skeleton:


skeleton = MyPrefix + "-" + MyTopic + ".app"
lnFileCount = adir(skeleton)

>2. MYPREFIX{space}{space}-MYTOPIC.APP

skeleton = MyPrefix + " -" + MyTopic + ".app"

>3. MYPREFIX-MYTOPIC2.APP
>4. MYPREFIX{space}{space}-MYTOPIC2.APP

Adding a single question mark will match both files with, and without, an additional character at the end.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform