Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subscript out of defined range error
Message
De
18/03/2005 14:45:22
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Subscript out of defined range error
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP1
Divers
Thread ID:
00997398
Message ID:
00997398
Vues:
45
Hello,
I am trying to perform a recursive file search, and I have gotten to the point where I am listing all of the directories. However, I keep getting a "Subscript out of defined range" error, and I can't figure out why. Can somebody take a look and give me some advice? Thanks!
CREATE CURSOR FILELIST ;
(filedir c(254), filename c(254), filedate D)


ReadFolder("FILELIST", "C:\", "*.*")

*******************************************************************
PROCEDURE ReadFolder
LPARAMETERS tcCursorName, tcPath, tcPattern
LOCAL lcCursorName, lcPath, lcPattern

lcCursorName = UPPER(tcCursorName)
lcPath = UPPER(tcPath)
lcPattern = UPPER(tcPattern)

lnCount = ADIR(DIRS,lcPath + "*.*" ,"D")

FOR x = 1 TO lnCount
**Error occuring on next line
	IF UPPER(SUBSTR(DIRS(x,5),5,1)) = "D" AND (ALLTRIM(DIRS(x,1)) <> "..") AND (ALLTRIM(DIRS(x,1)) <> ".")

   		ReadFolder(lcCursorName, lcPath + DIRS(x,1) + "\", lcPattern)
   	
   	ENDIF
   	
ENDFOR

RETURN
Very fitting: http://xkcd.com/386/
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform