Share via


Setting the Starting Point

You link each component together and set a starting point for your application with a main file. The main file serves as the execution starting point for your application, and can consist of a program or form. When users run your application, Visual FoxPro launches the main file for your application, which in turn runs all other components as needed. All applications must have a main file. Usually, the best choice is to create a main program in your application. However, you can combine the functionality of the main program and the initial user interface by using a form as the main program.

If you use the Application Wizard to create your application, you can allow the wizard to create a main file program for you. You don't need to specify a main file yourself unless you want to change the main file after the wizard is done.

To set the starting point for an application

  1. In the Project Manager, select the file.

  2. From the Project menu, choose Set Main.

    Note   The file that you set as the application's main file is automatically marked as included so that it is treated as read-only after you compile the application.

Only one file in the project can be set as the main file. The main file is displayed in bold type, as shown in the following illustration.

Setting a main file in the Project Manager

See Also

Structuring an Application | Compiling an Application | Initializing the Environment | Application Framework Files | Application Builder