Well, it can be as simple as
Code:
DO yourmenu.mpr && generated by genmenu from yourmenu.mnu
READ EVENTS
It would be advisable to have a menu item "Exit/Quit" that does CLEAR EVENTS.
The other most simple main.prg could be
Especially if the main form is modal it won't need a READ EVENTS, as the prg then will only get after the DO mainform.scx when the user closes that and thereby exits the application.
You can add to that with things like ON ERROR to establish an error handler, ON SHUTDOWN to define the reaction to a) a computer shutdown (so literally a shutdown event) or also b) to clicking the _screen window X button. In the simplest case ON SHUTDOWN QUIT.
then obviously also SET PATH to help the process find any file it needs external from the EXE. You can also program the main.prg with debugging of the development in mind, i.e. after CLEAR EVENTS also clear up things so the IDE itself is in a usable default state again. That indeed is very helpful to have a comfortable starting point for all your testing, too, instead of starting single forms or reports you start a test/development session with your main.prg and have a menu to start forms you currently develop and want to test, etc., which means you include the end-user experience and perspective in your development.
You can do more, it depends really on what you want and need and nobody can tell you. One normal thing is also to start the main form. Maybe you also don't have a menu and only one form, then the user obviously can't start forms from the menu and you need a DO FORM.
There are sample projects, too. Well, for one the solution application in HOME()+"Samples\Solution\Solution.pjx" which has a short and good main.prg sample including to set the default path, which also is a good idea. An error-handling function is defined within the solution.pjx main.prg and set with ON ERROR.
Further PJXes with theirmain.org are in the source code of all the wizards and builders of VFP, the IDE has lots of features that are themselves programmed in VFP, but those projects have no typical main.prg as they build components for the IDE. There is one Wizard though, that produces projects: The application wizard.
If you go through the application wizard, it will create a project based on the FFC (Foxpor foundation classes), but that would have been a route for you if you were at the start of your endeavor, because you could have built a project from scratch with many things already solved, like the main.prg
You find it in the menu tools->Wizard-applicaion wizard but also in the component catalog in the menu Tools-Component Gallery. There pick "Visual FoxPro Catalog" then "Templates" and finally "Applications", then there is the Application Wizard, but also templates for books, contacts and another generic wizard "New application".
They all create projects based on the FFC.
You obviously will need to adapt to your needs. But as said, nobody can tell you your needs. One other thing very typical for an OOP project is generating the application main class goApp. Which may then offer all functionality generally needed by an application like a form handler, a data access foundation, etc.
And then you can program anything into it that you want, a splash screen is one thing not so common anymore, but like always you can do anything you want. You seem to think of the main.prg as a necessity. No, it's just the starting point, so you know this is what executes first. You want our application not to quit immediately, well that mainly needs a form to start and stay open. And that's either a modal form needing to be closed by the user before it ends or a non-modal form plus a READ EVENTS, but you're free to do and establish anything else you want.
It would have been more natural in application development to start with this and not end here.
Chriss