Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using ADIR - Too many variables
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00486649
Message ID:
00486661
Vues:
11
>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")

** big assumption that something like this is what you're doing
If oFolder.Files.Count > 0
  ** create destination folder
  MD c:\folder1  
  For Each oFile In oFolder.Files
     ** here, maybe check oFile.Name etc.
     ** for the files you really want to move
     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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform