Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to distinguish doc and docx count
Message
 
À
19/06/2012 20:54:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01546401
Message ID:
01546403
Vues:
32
>>
>>For Each loAttachment In loMSG.attachments
>>loAttachment.SaveAsFile("c:\attachments\"+loAttachment.filename)   && save attachment
>>Next
>>
>>lnFileCountdocx = Adir(laFiles, "C:\attachments\*.docx")
>>lnFileCountdoc = Adir(laFiles, "C:\attachments\*.doc ")
>>
>
>Adir, by default, will take whatever the filtering is, matching its startup. Thus, .doc is found in .docx. This is why you get this result. However, when searching for .docx, you find only one because this is a filter with a higher precision, where only one file has this extension, starting with.
>
>I just did the test myself and it produces the same result. I have looked at the help and it doesn't provide much flexibility in regards to this.
>
>You may find various classes for that where developers have made available a better directory file lookup. Or, you can add a second level of verifiation once you get the initial laFiles variable. You can then scan it and lower the count if you find one file that doesn't match exactly what you are looking for. This is based on first observations. Maybe someone knows of additional parameters not in the help that can be used with that function so to return an exact match.

I'm wondering now if justext would yield the same results you describe. k
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform