Hi Agnes,
As mentioned elsewhere I ended up uninstalling/re-installing VFP and the problem disappeared so I can't do any further digging. However the problem was occurring with (AFAIK) all projects where this code was used and all were cured by the re-install which would seem to preclude any corruption in the PJX/PJT files.
Best,
Viv
>what do you get if you enter
>
?_vfp.ActiveProject.Files.Count
>on command line?
>
>If this fails what is
>
?_vfp.ActiveProject.Files
>and
>
?TYPE("_vfp.ActiveProject.Files")
>?
>
>Try this from plain command line as well as from a suspended hook method
>
>Agnes
>>Hi,
>>
>>My point was that, in my code, the problem was not with the FOREACH (or even,AFAICS, with the project object itself) - only with the .FILES collection - the debugger was showing it as 'could not be evaluated' but with a .Count of zero. Given that I don't think a for loop would have worked either.
>>
>>Regards,
>>Viv