>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?
>
>Thanks...
An array in VFP can only handle 65,000 elements, regardless of row and column counts.
So ADIR() will bomb if you have more than 13,000 files.
You would need to limit the number of files first - like *.dbf, then *.cdx, then *.fpt, e.g.
Or you could use the FileSystemObject to get the file list.
e.g. (e pluribus unum)
oFso = CreateObject("Scripting.FileSystemObject")
oFolder = oFso.GetFolder("c:\somefolder")
If oFolder.Files.Count > 0
MD c:\folder1
For Each oFile In oFolder.Files
oFile.Move(ForcePath(oFile.Name, "c:\folder1"))
EndFor
EndIf
You can get more info on the FileSystemObject from the VB help in MSDN Library Visual Studio 6.0 or online at msdn.microsoft.com
Insanity: Doing the same thing over and over and expecting different results.