Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems accessing the Project Files Collection
Message
From
24/11/1999 19:22:25
 
 
To
24/11/1999 17:26:13
Eric Wolfe
Health Management Technologies
Lafayette, California, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00295359
Message ID:
00295404
Views:
22
>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.

So far, all of the evidence of a problem is with VFP and its handling of COM collections. The ADO example, and the Project manager example are both iterating through collections in a COM interface. I haven't tested this to compare with a native VFP object (I didn't have one handy with a big enough collection) so I can't say if this is true or not- I just wanted to point out that your examples show no evidence of a problem with native VFP objects. (The project object is NOT a native VFP object).
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform