Page 1 of 1

Super NOOB question

Posted: Mon Apr 20, 2015 10:06 pm
by gddeluca
OK, I'm stymied. I use FORM -> New, create a simple little window, and it compiles and runs this basic skeleton just fine.

So I save it as a .PBF file, and figure I'll make it the basis for a new Project. So I create the Project, include the newly created .PBF file, setup all the options to what seem like reasonable values.

But now any and every Compile and Run that I do simply results in:
Waiting for executable to start...
Executable type: Windows - x64 (64 bit, Unicode)
Executable started.
The Program execution has finished.
No window appears, nothing. No compiler diagnostics, just nothing.

If I close everything and simply open my saved .PBF file, it again compiles and runs properly, so obviously I've mucked up the Project settings.

What kinds of dumb errors can I have been making?

George

Re: Super NOOB question

Posted: Mon Apr 20, 2015 10:32 pm
by IdeasVacuum
Hello George

Most Users here are from the pre-form-designer era, so probably don't use it the way you have (though you are no doubt using it as the author, Polo, intended).

Post your code, then someone can see what is going on. It should be something simple :)

Re: Super NOOB question

Posted: Mon Apr 20, 2015 11:07 pm
by Trond
I'm new with the new forms feature (also I don't use the projects feature), but as far as I can tell, you need to explicitly open the form.

Open the help file and look at "Form designer".

At the very minimum you need a separate file (no the form file) like this:

Code: Select all

XIncludeFile "formfile.pbf"
OpenWindow_0() ; this is the default name
Repeat
  Event = WaitWindowEvent()
Until Not Window_0_Events(Event) ; also the default name

Re: Super NOOB question

Posted: Tue Apr 21, 2015 3:08 pm
by TI-994A
Hello George, and welcome to the PureBasic forum. :D
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. :D

Re: Super NOOB question

Posted: Tue Apr 21, 2015 5:11 pm
by gddeluca
Thank you all for the help. I now have a working skeleton.

I'm exploring PureBasic as I'm afraid I really have to start getting off PowerBasic. Since Bob Zale died, it has been rudderless and basically dead. And I don't see any white knight on the horizon to save it. Now I gather it is up for sale, but I doubt that would do it.

Too bad, it was a good platform for many years, great support forums, etc. but I think it's time to go through the pain of porting to PureBasic and move on.

I have another noob question, but I'll ask that in a different thread.

Many thanks again,

George

Re: Super NOOB question

Posted: Tue Apr 21, 2015 5:26 pm
by firace
IMHO a simple solution is to ensure that these 2 preferences are enabled:

Image

Re: Super NOOB question

Posted: Tue Apr 21, 2015 5:34 pm
by gddeluca
firace: Thanks for the tip, especially since I now know (the hard way) the significance of those options.

George