Intro
Lightsoft make an excellent point (in the PowerFantasm User Manual) regarding
creating all your programs as `modular' projects. Initially I found this
a bit of a pain.
By a pain, I mean, it takes a couple of minutes to set up the project file
and the other folders. But it is a good way to structure your work.
What Is A Project?
A project is simply a 'hitching post' where all your source files are tied
to.
It's probably easiest to think of a project as 'something that holds it
all together'. When you have set your programs project file up all your
settings are saved in your programs project file. This makes it very
easy to pick up where you left off.
Those of you who have had some experience with other compilers will be familiar with this concept. For those new to programming the Mac with PowerFantasm, well, this is for you. I'll walk you through the process.
BTW: My documents merely present some guidelines to (hopefully) assist you when creating your PowerFantasm projects. This is not `the law', use whatever structure you prefer. Throughout this document I assume you are fairly Mac-savvy - you know how to navigate through folders, select text and so on. To add a sense of reality to all this I made up a fictional name for my fictional program - SuperEdit. Whenever you see SuperEdit mentioned just replace with the name of your program.
Setting Up The Folders
For the purposes of this discussion my program is called "SuperEdit".
So I create a new folder and name it "SuperEdit Folder". Double-click
to open the "SuperEdit Folder" and inside it create 4 more new
folders called "SuperEdit Source", "SuperEdit Globals",
"SuperEdit Libraries" and "SuperEdit Output".
Below is a diagram showing how your program folder might look like.
Step 1 : The Folders
Create the folders. Use the structure outlined in the (beautiful) diagram
above. Remember, it is only an example.
BTW: My personal choice is to keep everything related to a program in one folder (i.e.: I leave the Project `loose' in the main program folder). If you like you could place all your Project files in another folder (on your hard disk) so that if you want to work on a program you only have to find and double-click the associated Project file and off you go. It's up to you.
Step 2 : The Build Control File
Launch Eddie (LightSoft's super-duper text editor) or any other plain-Jane
text editor (as long as it supports tabs). From the File menu select `New...',
again from the File menu select `Save as...' - name the file "SuperEdit.BCF"
and save it in the `SuperEdit Source' folder.
FYI: The Build Control File, or BCF for short, is the centre of
the universe. Well, the centre of the PowerFantasm universe anyway. Basically,
the BCF tells PowerFantasm what source files to assemble and then what source
files to link in order to create your application.
We'll go into more detail next time.
Step 3 : Set Up The Paths
Launch PowerFantasm. From the Project menu select Project Setup then select `Paths'. Set the Paths up as follows by clicking on the relevant button:
PATH NAME SET PATH TO
Build Control File SuperEdit Source folder and
select your BCFfile
(e.g.: SuperEdit.BCF)
Source file SuperEdit Source folder
Global Includes SuperEdit Globals folder
Output SuperEdit Output folder
Shared Incbins Not used here
SA Output Not used here
Standard Libraries LS Standard Libraries
User Libraries SuperEdit Libraries folder
Headers V4 Headers
At this stage it is not vital to know what the LS Standard Libraries and V4 Headers contain - we will come back to those later. Just make sure the paths for them are set as detailed above.
BTW: While you do not have to go to all this trouble. I recommend it so you avoid the `paths not set' error messages that can sometimes cause confusion - especially if you are new to PowerFantasm.
Step 4 : Creating The Project File
Immediately after setting up the Paths click OK to exit the Paths dialog. From the File menu select `Save project set-up as...' - save it as `SuperEdit.P'. The `.P' is the extension I give my project files, you may wish to use another method. The title of the main PowerFantasm window will change to reflect the Project name. Finally, go back and double check that the paths are set up correctly.
FYI: Remember before I said the BCF file was the centre of the
universe (as far as PowerFantasm is concerned)? Um - I sort of lied! The
project file is the centre of the universe.
No, truly!
The project file remembers your paths, preferences and it is a very convenient way of picking up where you left off. The BCF file controls how the various source files are assembled and linked.
Finally... Not so bad was it? Yeah, pretty elementary stuff I
know. It aint rocket science!
If you are new to PowerFantasm and you have this little lot under your belt,
well, you will avoid any elementary errors and you will have a solid foundation
for my future dissertations. (That's if Stu lets me write again :-)). (No
probs my man! - SB)
Next time around I'll expand on some of the points that have been raised here and start exploring our very first program. Stay tuned!
Copyright Lightsoft 1996.