Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADIR optimization
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00542818
Message ID:
00542840
Vues:
45
>>>>I am using ADIR to get a specific number of files from a directory based on a criteria. So, ADIR(laFile,gcFat+'thread\*.*') will create an array and I can now use ALEN(laFile,1) to get the file count. However, on big directory this is causing a big array to be created just to get the number of files. How can I optimize that?
>>>
>>>lnFiles=adir(laFile,gcFat+'thread\*.*'), e.g. adir returns number of files.
>>>
>>>Too bad, you don't have Help installed...
>>
>>BTW, another alternative would be to use FileScriptingObject. Check George's Tasker and Ed Rauh article in VFUG for details.
>
>It's FileSystemObject.

I knew, I would confuse it :) I'm reading this article now...
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
     oFolder = oFSO.GetFolder("gcFat+'thread\")
     lnFiles=oFSO.oFolder.Files.Count
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform