Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADIR() with too many files. Workaround for VFP8.
Message
De
25/07/2007 17:17:20
Mike Yearwood
Toronto, Ontario, Canada
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01243606
Message ID:
01243609
Vues:
22
>* 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()
>
Why not use sys(2000) and be able to scan all files without exceeding such a limit? ;)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform