Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using ADIR - Too many variables
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00486649
Message ID:
00486745
Views:
10
>I'm trying to right a procedure that will take a directory with several thousand files in it and break it up into CD sized directories. I'm using the ADIR() command - but get "too many variables" when I attempt to run the command. I vaguely remember from my Clipper days that arrays could only handle up to 4096 rows. Is that true in VFP6.0? If so, does anyone have an idea how to accomplish what I need?

VFP allows up to 65,000 elements in an array - this means that a directory with more than 13,000 files in it will blow up ADIR(). You can use the Scripting.FileSystemObject from the WSH to handle very large folders; there is no upper limit on its Files or SubFolders collections in a Folder object. There are examples in the FAQ comparing using ADIR() to using the FSO.

Another approach would be to use SYS(2000) to process file-by-file, and then populate a cursor with the relevant information for each file.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform