>>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...
Yes, based on that code, it could be optimized this way. However, the problem is with the creation of the array. I'll try Larry's suggestion.