This wiki is out of date, use the continuation of this wiki instead

Program

From FenixWiki

Revision as of 02:46, 5 January 2008 by Sandman (Talk | contribs)
Jump to: navigation, search

Up to Basic Statements



Definition

Program <programname>;

Program is a reserved word used to begin your program. It's not needed to start a program with it.

Using Process Main() is also possible.

Example

Program example; // Name this program "example", which doesn't really matter
Begin // Start the main code
    Loop
        frame;
    End
End // End the main code

When the End of the main code is reached, the program exits, if there are no processes alive anymore, which is logical, as Fenix quits when there are no processes running and Program is a process as well. As the matter of fact, you can leave the whole Program business out and throw in a process called Main, which will be called when the program is started:

Process Main() // This process is started when the program is started
Begin // Start the main code
    Loop
        frame;
    End
End // End the main code
Personal tools