- This wiki is out of date, use the continuation of this wiki instead
Basic statements
From FenixWiki
(Difference between revisions)
Revision as of 13:07, 24 July 2007 (edit) Sandman (Talk | contribs) (New page: category:reserved category:language Below are explained the basic statements of Program and Process and where to declare all the types of variables. For prototyping se...) ← Previous diff |
Current revision (12:41, 9 November 2007) (edit) (undo) Sandman (Talk | contribs) m |
||
(3 intermediate revisions not shown.) | |||
Line 1: | Line 1: | ||
- | [[category: | + | [[category:general]] |
- | + | ||
Below are explained the basic statements of [[Program]] and [[Process]] and where to declare all the types of [[variables]]. For prototyping see [[Declare]]. | Below are explained the basic statements of [[Program]] and [[Process]] and where to declare all the types of [[variables]]. For prototyping see [[Declare]]. | ||
- | == Basic | + | A list of basic statements: |
+ | * [[Program]] | ||
+ | * [[Process]] | ||
+ | * [[Function]] | ||
+ | * [[Declare]] | ||
+ | * [[Begin]] | ||
+ | * [[OnExit]] | ||
+ | * [[End]] | ||
+ | * [[Private]] | ||
+ | * [[Public]] | ||
+ | * [[Local]] | ||
+ | * [[Global]] | ||
+ | * [[Const]] | ||
+ | |||
+ | == Basic statements == | ||
<pre> | <pre> | ||
Program example; | Program example; | ||
Line 38: | Line 51: | ||
End | End | ||
OnExit // Start the exit code part of the process | OnExit // Start the exit code part of the process | ||
+ | End | ||
+ | |||
+ | Function int func1() | ||
+ | Public // Start the public variables part of the function | ||
+ | Private // Start the private variables part of the function | ||
+ | Begin // Start the main code part of the function | ||
+ | return 0; | ||
+ | OnExit // Start the exit code part of the function | ||
End | End | ||
</pre> | </pre> | ||
- | Used in example: [[ | + | Used in example: [[basic statements]], [[loop]], [[return]], [[frame]] |
Global, constant, local and private parts of the program can be scattered through the code, between processes and functions. Sometimes the End can be left out, but it's good practice to keep it in. When a variable or constant is declared, it's only viewable or editable for statements ''beneath'' the declaration. For more info on that, see [[prototyping]]. | Global, constant, local and private parts of the program can be scattered through the code, between processes and functions. Sometimes the End can be left out, but it's good practice to keep it in. When a variable or constant is declared, it's only viewable or editable for statements ''beneath'' the declaration. For more info on that, see [[prototyping]]. | ||
Note that when [[Declare]] is used, the [[Public variable]]s have to be declared in the Declare block and not in the process block. | Note that when [[Declare]] is used, the [[Public variable]]s have to be declared in the Declare block and not in the process block. |
Current revision
Below are explained the basic statements of Program and Process and where to declare all the types of variables. For prototyping see Declare.
A list of basic statements:
[edit] Basic statements
Program example; Global // Start a global variables part of the program End Const // Start a constants part of the program End Local // Start a global variables part of the program End Private // Start a private variables part of the main process End Begin // Start the main code part of the main process proc1(); // create new instance of proc1 Loop frame; End OnExit // Start the exit code part of the main process End Global // Start a global variables part of the program End Const // Start a constants part of the program End Local // Start a global variables part of the program End Process proc1() Public // Start the public variables part of the process Private // Start the private variables part of the process Begin // Start the main code part of the process Loop frame; End OnExit // Start the exit code part of the process End Function int func1() Public // Start the public variables part of the function Private // Start the private variables part of the function Begin // Start the main code part of the function return 0; OnExit // Start the exit code part of the function End
Used in example: basic statements, loop, return, frame
Global, constant, local and private parts of the program can be scattered through the code, between processes and functions. Sometimes the End can be left out, but it's good practice to keep it in. When a variable or constant is declared, it's only viewable or editable for statements beneath the declaration. For more info on that, see prototyping.
Note that when Declare is used, the Public variables have to be declared in the Declare block and not in the process block.