Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

CREATE PROJECT, MODIFY PROJECT

These two commands open the Project Manager. Both can be used whether or not the project already exists. Their behavior differs in how they handle that situation and in what they do when you don’t tell them what project to open.

Usage

CREATE | MODIFY PROJECT [ ProjectName | ? ]
        [ NOWAIT ] [ SAVE ]
        [ WINDOW TemplateWindow ]
        [ IN [ WINDOW ] ContainerWindow | SCREEN ]
        [ NOSHOW ]
        [ NOPROJECTHOOK ]

Both CREATE PROJECT and MODIFY PROJECT have one very neat capability. If you use either one to start a new project, and then decide to bag it before you put anything in the project, a dialog appears asking whether to delete the empty project from the disk. Having a choice here is really nice. We can think of two very different scenarios. Scenario 1 is the more common one—you've mistyped the name of the project you want to work on or you're in the wrong directory. In that case, you press Esc to get out and you can get rid of the misnamed project. In scenario 2, you want for some reason to create an empty project—you can do it.

The WINDOW and IN WINDOW clauses are meant to give you flexibility in where and how the Project Manager appears, similar to what you get with MODIFY COMMAND or BROWSE. However, they don't work. Frankly, we're not sure why you'd want these clauses for these commands anyway.

NOWAIT, on the other hand, is useful. If you MODIFY PROJECT in a program, it lets you continue the program, leaving the project open. SAVE keeps the project window open when you open it programmatically and the user then makes another window active.

The bottom line is that you’ll use these commands a lot from the Command Window in their most basic form. Before VFP 6, you were very unlikely to put them in programs. However, the ability to address a project as an object and the project hook base class means that we can do a lot of manipulation of projects programmatically. So these commands get more programmatic use than they did before.

The NOSHOW and NOPROJECTHOOK keywords were new in VFP 6 and, while not directly related to each other, they’re really both related to the addition of project hooks. NOPROJECTHOOK is sort of obvious—when you use it, the project is opened without creating an associated project hook object. That means, of course, that you can’t do all the things with the project that you can when you have a project hook.

So how does NOSHOW relate to project hooks? Well, until we had them, there wasn’t much reason to want to open a project without showing the Project Manager. Now you might want to open a project and have all kinds of things going on in code without anything being visible.

Example

CREATE PROJECT MyCoolProject

See Also

Build App, Build Exe, Build Project, Project, ProjectHook, Projects