Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADIR() with too many files. Workaround for VFP8.
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
ADIR() with too many files. Workaround for VFP8.
Miscellaneous
Thread ID:
01243606
Message ID:
01243606
Views:
65
* 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()
Next
Reply
Map
View

Click here to load this message in the networking platform