Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to distinguish doc and docx count
Message
From
19/06/2012 21:06:33
 
 
To
19/06/2012 20:54:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01546401
Message ID:
01546403
Views:
31
>>
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform