Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADIR() Foible
Message
From
24/09/2003 11:14:32
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
ADIR() Foible
Miscellaneous
Thread ID:
00831863
Message ID:
00831863
Views:
56
Hello all,

I've just come across an interesting foible with the ADIR() function.

I have a folder that contains 21 files. 10 of them are named 'SUPP_NCOA_XXXXXXXX.OUT' and 11 are named 'SUPP_XXXXXXXX.OUT'

The eight X's are a random string (using SUBSTR(SYS(2015), 3, 10))

I am trying to use ADIR() to populate an array with all the shorter filenames. To do so I run the following:

LOCAL lnFiles
lnFiles = ADIR(laMyFiles, 'c:\mydir\supp_????????.out')

The returned array should contain all 11 of the files with shorter names as the '?' wildcard represents only 1 character.

However, the array contains not only those 11 but also the first four (chronologically) of the files with the 'NCOA_' string within the name. In theory this is impossible as the eight question mark wildcards would force the exclusion of these four files on account of the extra five characters.

Can anybody help shed any light on why this happens. I have reproduced the effect on two machines, both running VFP 6.0 sp5 on Windows 2000 sp3. In both cases only the first four of the erroneous files are found in the resulting array.

Many thanks for any help/advice that might be given,

Regards,

Ben Sugden
Ben Sugden

"Remember to enjoy hunting - and that means relishing the search for the product that has never been advertised or placed handily at the front of the shop; Life begins on the uppermost shelf, avoid guide books and top 10's like the plague." - Ramsey Dukes
Next
Reply
Map
View

Click here to load this message in the networking platform