- This wiki is out of date, use the continuation of this wiki instead
Father
From FenixWiki
(Difference between revisions)
Revision as of 13:39, 1 May 2007 (edit) Sandman (Talk | contribs) ← Previous diff |
Revision as of 13:43, 1 May 2007 (edit) (undo) Sandman (Talk | contribs) Next diff → |
||
Line 5: | Line 5: | ||
'''INT''' father | '''INT''' father | ||
- | Father is a predefined [[local variable]]. Every [[process]] has this varaible as soon as the [[frame]]; statement is reached within the process. Father holds the [[ProcessID]] of the process that called the current process. There are several other | + | Father is a predefined [[local variable]]. Every [[process]] has this varaible as soon as the [[frame]]; statement is reached within the process. Father holds the [[ProcessID]] of the process that called the current process. There are several other local variables which refer to the ProcessID of a related process: |
*[[Son]] | *[[Son]] | ||
*[[Bigbro]] | *[[Bigbro]] | ||
Line 12: | Line 12: | ||
== Example == | == Example == | ||
<pre> | <pre> | ||
- | + | Program example; | |
- | + | Begin | |
- | + | first_process(); | |
- | + | Loop | |
- | + | frame; | |
- | + | End | |
- | + | End | |
- | process second_process() //declaration of another process | + | Process first_process() // Declaration of the first process |
- | + | Begin | |
- | + | second_process(); // Call the second process | |
- | + | Loop | |
- | + | frame; // This loop makes "first_process()" a process rather than a function | |
- | + | End | |
- | + | End | |
- | + | ||
+ | Process second_process() //declaration of another process | ||
+ | Begin | ||
+ | x = father.x; // These two lines use the father variable to move this process | ||
+ | y = father.y; // to the position of first_process, as the father variable here | ||
+ | // holds the ProcessID of "first_process()" | ||
+ | Loop | ||
+ | frame; | ||
+ | End | ||
+ | End | ||
</pre> | </pre> | ||
- | + | Used in example: [[process]], [[function]], [[processID]] |
Revision as of 13:43, 1 May 2007
Definition
INT father
Father is a predefined local variable. Every process has this varaible as soon as the frame; statement is reached within the process. Father holds the ProcessID of the process that called the current process. There are several other local variables which refer to the ProcessID of a related process:
Example
Program example; Begin first_process(); Loop frame; End End Process first_process() // Declaration of the first process Begin second_process(); // Call the second process Loop frame; // This loop makes "first_process()" a process rather than a function End End Process second_process() //declaration of another process Begin x = father.x; // These two lines use the father variable to move this process y = father.y; // to the position of first_process, as the father variable here // holds the ProcessID of "first_process()" Loop frame; End End