Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADIR and getting multiple file extensions
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01222395
Message ID:
01223007
Views:
20
>If I wanted to get multiple file extensions, such as ".001", ".002" and so on up to maybe ".199" into the ADIR() array, how would I pick that up?
>
>The below is how it is now, but you may see that that limits me to only 99 different file extensions. Yes, this is really a naming convention for these Graphics files.
>
>
>cFiles=cJPGCode + ".0*"	&& Example: "BM00&)TZ.001"
>* Get the number of IMAGE files for this person.
>* Place each filename into an array.
>nNumberOfImageFiles=ADIR(aFileName, cFiles)
>
I created a little tool that would help in our situation.

Download my Query tool, and run the following code. It fills the array with the filename for only those that meet the WHERE condition.
DIMENSION laFIles[1]
? Query([Select Name from file "*.*" where JUSTEXT(Name) between "001" and "199" order by name into array laFiles])
I hope it helps. I know I use it alot with various data list sources other then files.

FYI, I published a release of this tool on CodePlex and am asking for you or anyone to join the project to improve and critique it.
Greg Reichert
Previous
Reply
Map
View

Click here to load this message in the networking platform