Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Phantom documents in the project manager 1

Status
Not open for further replies.

GriffMG

Programmer
Mar 4, 2002
6,333
FR
I am developing a project which is broadly similar to one or two that I have done before. They both WILL have forms in them called AddOrder for example (the existing one already has it).

I haven't developed AddOrder in my new project yet, but I have put the code in to call it (do form AddOrder) while I am developing the orders form.

When I compile the project, it goes and finds AddOrder in the old project and adds it to the new project... which has once or twice caused me to accidently edit a form from the wrong job!

Is there any way to prevent this behaviour?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
This will happen if the new project's search path - at the time you do the compile - includes the directory holding the AddOrder form in the old project.

The compiler sees a command such as DO FORM AddOrder, so it knows you need that form in your project. It searches along the path, finds the form, and adds it.

The best solution is, of course, to keep your directories completely separate. Here's what I do:

1. Set up a root directory for each project.

2. Within that directory, I have a separate directory for forms, reports, classes, etc. These have the same names across projects (so, my forms directory is always called Forms, for example).

3. In the main program for each of your projects, set the default directory to the root directory:
SET DEFAULT TO JUSTPATH(SYS(16))

4. Also in each main program, set the path:
SET PATH TO Forms, Reports, Classes ....
Note the relative directory names here. They're relative to the default directory, which is specific to the project.

5. When calling a form (or referencing any other component), be sure not to include the path.

6. When you first load VFP, do a CD to the root directory of the project you are working on. You can then forget about paths during the rest of the session. Everything will fall into place, and you won't have the problem you described.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Hi Mike

I do keep a separate folder for each project, although I don't break them down into forms, classes and reports (I can see why that would clear some of the clutter).

The behaviour I'm finding curious is that VFP seems to be traversing 'up' and 'across' to locate the AddOrder form from the other project - it didn't SEEM to do this in VFP6.

I'll try some of your suggestions and see if they help.

I like the CD one.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Martin, yes that does seem curious. Are you haven't got absolute paths stored in Tools / Options / File Locations / Search Paths? Although I don't see how that would explain the "up and across" behaviour.

Re the CD tip: It's even better with Intellisense. All you have to do is type CD and a space, and then pick the directory from the list that Intellisense pops up.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Found it!

Mike, none of those tips solved the problem.

So, as the new forms and reports were all coming from the same old project, I renamed that folder temporarily.

The compile then threw an error looking for a .h file that was included by accident in the project... removed that and bingo!

Thanks for making me follow it through!

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Nah, takes a BIT more than that to spoil a weekend!

It actually looks in the other folder if ANY included file
comes from there!


Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top