Hello George, and welcome to the PureBasic forum.
gddeluca wrote:...I use FORM -> New, create a simple little window, and it compiles and runs this basic skeleton just fine.
Actually, the code generated by the Form Designer is only validated, but never executed. All the executable code is encapsulated within procedures that must be called before they can be executed. When you press the
F5 key, Form Designer is only displaying the window to let you see what it would look like when it is ultimately run - one of its many features.
Before continuing on to the intricacies of PureBasic's Projects, it could perhaps be helpful to understand how the Form Designer actually works. Here's a
mini-tutorial that I had posted a couple of months back, in response to a form-related question. It's a simple step-by-step that you might find useful. In any case, I'll be using the sample codes from that post to illustrate the use of PureBasic's Projects.
Note: In the above-linked example, the form file was named MyForm.pbf, but no specific name was indicated for the procedures file. For the purposes of the following example, the procedures file will be named MyProc.pb.
gddeluca wrote:...I create the Project, include the newly created .PBF file, setup all the options to what seem like reasonable values. But now ... No window appears, nothing.
PureBasic's Projects is a useful grouping tool, not only for collating forms and source files, but also for setting IDE and compiler options, and for managing multiple builds as well.
To see it in action, simply start a project by selecting
New Project under the
Project menu. Name the project as desired, and press
Create.
In the resulting window, click the
Project Options button at the top, and then click the
Project Files tab in the dialog that opens. From the file explorer panel on the left of this options dialog, select and add the two files created in the Form Designer tutorial,
MyForm.pbf and
MyProc.pb. Selected files are added by clicking on the
Add button above the file window on the right of the options dialog. Once done, click
Ok.
Now, click on the
Compiler Options, and in the dialog that opens, select the
Default Target in the left panel. Then, in the right panel, under the
Compiler Options tab, click on the file selector
[...] next to the
Input Source File text box. Select and add
MyProc.pb from the file explorer, and click
Ok.
That's it! Save the project for good measure, and press
F5 to run it.
So, what makes a PureBasic Project any different from a well-linked, well-included multi-file, multi-form application? Let's explore that.
To open any of the project source files, simply double-click on them in the
Project Files window. In fact, try opening the
MyProc.pb source file, and on any line, start typing in the variable name
EventButtonOK. This is a variable declared only in the
MyForm.pbf file, but you'll notice that it's listed in PureBasic's auto-complete context menu as well. One of the features of PureBasic's Projects.
Another would be to automatically compile for different platforms
(for example x86 and x64, using different compiler versions for separate builds - not cross-platform) with a single compile. There are obviously numerous others, which I believe are pretty well documented in the manual, but this should give you a pretty good idea.
Just a short and simple primer, but I hope that you'll find it helpful.
