Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADIR() with too many files. Workaround for VFP8.
Message
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01243606
Message ID:
01243613
Views:
25
Mark,

How usefull could be random subset of files?

>* This harvests the max number of files without crashing.
>* If ADir() crashes, the array is left intact as a 1-D array
>* so it has to be redimensioned, but what was already loaded stays intact.
>
>lExceeded=.F.
>TRY
>  nFiles=ADIR(aTheFiles,"X:\MyPath\*.*")
>CATCH
>  * Too many files.  Limiting the scan to max files retrieved.
>  lExceeded=.T.
>  nFiles=INT(ALEN(aTheFiles) / 5)
>  IF nFiles > 0
>    DIMENSION aTheFiles(nFiles,5)
>  ENDIF
>ENDTRY
>* Check lExceeded to determine the outcome of adir()
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform