PRB: Cannot Get Individual Items from the Projects Collection

ID: Q196023


The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 6.0


SYMPTOMS

Referencing a project collection's item without the keyword 'Item' may cause the following error:

File '<filename>' does not exist.


RESOLUTION

To access an individual item, use the following syntax:


   oProj = APPLICATION.ACTIVEPROJECT
   oFiles = oProj.FILES
   oFile = oFiles.Item[1]
   ?oFile.NAME 


STATUS

This behavior is by design.


MORE INFORMATION

Steps to Reproduce Behavior

Run the following code from a program file with a project in memory that has at least one file attached to it:

   oProj = APPLICATION.ACTIVEPROJECT
   oFiles = oProj.FILES
   oFile = oFiles[1]
   ?oFile.NAME 
RESULTS: The third line returns the following error:
File 'ofiles.prg' does not exist.

Additional query words:

Keywords : kbProjManager kbVFp600
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: December 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.