Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADIR Doesn't Respect Arrays
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00265065
Message ID:
00265081
Vues:
17
>
>My stinky code:
>
>	nNumFiles = adir(arFileList,_arRegSet[11,2]+'\*.*')	
>	for nLoopMe = 1 to nNumFiles
>		cTempString = arFileList[nLoopMe,1]+chr(13)
>	next nLoopMe
>	nCharsWritten = StrToFile(cTempString,'TarInput.txt')
>
>
>
>This bombs because nNumFiles returns 0.
>
>If I change the first line of code to read
>
>
>        nNumFiles = adir(arFileList,'e:\src\projects\t1\*.*')	
>
>
>It works fine, but I can't hardcode my paths. Help?

Don't know why it would croak on array contents if they are valid for a dir. have you checked the value in the array to make sure it yields a valid dir path? If so, can you create an intermediate variable:

Mydir = _arRegSet[11,2]+'\*.*'
* Check for valid dir string here
nNumFiles = adir(arFileList,Mydir)
IF nNumfiles = 0
* something is wrong
ELSE
* run your code
ENDIF

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform