>I'm working on a data transfer project where ARC files are expanded into new directories and ADIR() is used to return the file names and file count.
>
>When there are more than 65,000 files expanded, VFP 6.0 errors with Too many variables. (array limit reached).
>
No, it's when there are more than 13000 files; 5 columns * 13000 = 65000, the limit of the number of array elements. There's an easy workaround; use the Scripting.FileSystemObject to access the Folder; it produces collections of files and subfolders which can be of any siz3e, and whose counts can be accessed as properties of the Folder object:
oFSO = CREATEOBJ('Scripting.FileSystemObject')
oFolder = oFSO.GetFolder('C:\MyRandomDir')
? oFolder.Files.Count
FOR EACH oFile IN oFolder.Files
? oFile.Name
ENDFOR
You might want to look at the articles that George Tasker and I wrote for VFUG about the WSH;
www.vfug.org