Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems accessing the Project Files Collection
Message
De
24/11/1999 17:26:13
Eric Wolfe
Health Management Technologies
Lafayette, Californie, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Problems accessing the Project Files Collection
Divers
Thread ID:
00295359
Message ID:
00295359
Vues:
51
I just wanted to know if anyone else had performance problems associated with looping through the Files Collection of the Project Object in VFP6. This code works, but is EXTREMELY slow. I've got about 600 files in my project and it takes over 1 second to process this loop one time. Just open any VFP6 project onto the desktop and run this code in a prg.

WITH _VFP.Application.ActiveProject
nFileCount = .Files.Count
? alltr(str(nFileCount)) + " total files in the project."

FOR nCount = 1 TO nFileCount
nTime = seconds()
set message to "File=" + .Files.Item(nCount).Name
? "Loop Time=" + alltr(str(seconds() - nTime,10,6))
ENDFOR

ENDWITH

I know VFP has problems with enumerations (FOR EACH - see http://members.home.net/bmassi/gotchas.htm) and if I use it here instead of the FOR..NEXT loop then VFP stops responding.

I'm starting to wonder about VFP and its handling of collections. I'm begining to think we've got a problem.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform