Difference between revisions of "Program"

From Bennu Wiki
Jump to navigation Jump to search
 
(No difference)

Latest revision as of 01:21, 23 November 2009


Up to Basic Statements



Syntax

Program <programname> ;

Description

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

It should be noted that this is for backwards compatibility only, because it doesn't actually do anything.

Example

Program example; // Name this program "example", which doesn't really matter

Process Main() // This process is started when the program is started
Begin
End

When the End of the main code is reached, the program exits, if there are no processes alive anymore, which is logical, as Bennu quits when there are no processes running and Main is a process as well. This process is just like any other process with the addition it gets called when the program starts. This means that you can also call the process using main().


Keywords
Basic statement BEGINCONSTDEBUGDECLAREENDFUNCTIONGLOBALLOCALONEXITPRIVATEPROCESSPROGRAMPUBLIC
Control flow statements BREAKCALLCASECONTINUEDEFAULTELIFELSEELSEIFELSIFFORFRAMEFROMGOTOIFJMPLOOPREPEATRETURNSTEPSWITCHTOUNTILWHILEYIELD
Misc INCLUDEIMPORT