Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Build directory structure
Message
De
13/08/2009 15:03:38
 
 
À
13/08/2009 10:21:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01417859
Message ID:
01417980
Vues:
60
Try with the following changes (I removed the APPEND/REPLACE and use an INSERT INTO...
mBuildCustomerDocumentStructure('entrypoint\*.*', 1)

*mBuildCustomerDocumentStructure

LPARAMETERS tcStartPoint, tnParentId
LOCAL lnFileNumber, lnMenuId, lnCount, arr
WITH This
	DIMENSION arr (1, 1)
	IF !USED('tree')
		CREATE CURSOR tree (menuid I, parentid I NULL, name char(100), folder I DEFAULT 1)
		INSERT INTO tree (menuid, parentid, name) VALUES (1,NULL,'Customer Documents')
*		APPEND BLANK		
*		REPLACE menuid WITH 1, ;
*			parentid WITH NULL, ;
*			name WITH 'Customer Documents'
	ENDIF
	SELECT tree
	lnFileNumber = ADIR(arr, tcStartPoint, 'D')
	FOR lnCount = 1 TO lnFileNumber
		IF arr(lnCount, 1) = '.'
			LOOP
		ENDIF
			
		GO BOTTOM
		lnMenuId = menuid + 1
*		APPEND BLANK		
*		REPLACE menuid WITH lnMenuId, ;
*			parentid WITH IIF(RECCOUNT() = 1, NULL, tnParentId), ;
*			name WITH IIF(RECCOUNT() = 1, 'Customer Documents', arr(lnCount, 1))
		INSERT INTO tree (menuid, parentid, name) ;
			VALUES (lnMenuId,IIF(RECCOUNT() = 1, NULL, tnParentId),IIF(RECCOUNT() = 1, 'Customer Documents', arr(lnCount, 1)))
		IF AT('D', arr(lnCount, 5)) # 0
			.mBuildCustomerDocumentStructure(STRTRAN(tcStartPoint, '*.*', '') + arr(lnCount, 1) + '\*.*', menuid)
		ELSE
			REPLACE folder WITH 0	
		ENDIF		
	ENDFOR
ENDWITH
>Hi Mark,
>
>depends on where the slowness comes from... When it's your code, we might be able to help if you show it to us. If the problem is the mere number of directories, there's little you can do except for using cached or indexed information.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform