Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Documenting utilities
Message
De
05/06/2007 13:20:17
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01230587
Message ID:
01230671
Vues:
27
>I'm trying to determine what programs/classes/reports/etc are actually used in a fairly huge VFP project.
>
>I'd like to come up with a reference list that shows what is NOT used (we know there is a lot that is no longer referenced) and a list that shows what IS used and where it is used. If we had a couple of months we might get this out of coverage profiler but this is a very complex system.

Create a new project and add the main program to it. Then, use Rebuild project to pull everything else in. Then, you can use code like the following to figure out what's not pulled in. Be aware, though, that files used indirectly will turn up on that list.
LPARAMETERS cOldProject, cNewProject

LOCAL oOld as VisualFoxpro.IFoxProject, oNew as VisualFoxpro.IFoxProject

MODIFY PROJECT (m.cOldProject) NOWAIT 
oOld = _VFP.ActiveProject

MODIFY PROJECT (m.cNewProject) NOWAIT 
oNew = _VFP.ActiveProject

CREATE CURSOR Missing (mFile M)

LOCAL oFile, oNewFile, cFileName

FOR EACH oFile IN oOld.Files
	* Look for each file from the old project in the new project.
	* The filename without path is the key in the collection.
	cFileName = JUSTFNAME(oFile.Name)
	
	TRY
		oNewFile = oNew.Files[m.cFileName]
		
	CATCH  
		* Used in old, not in new
		INSERT INTO Missing VALUES (oFile.Name)
		
	ENDTRY
ENDFOR
Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform