- This wiki is out of date, use the continuation of this wiki instead
Exists
From FenixWiki
(Difference between revisions)
| Revision as of 14:00, 19 April 2007 (edit) Sandman (Talk | contribs) m (→Definition) ← Previous diff |
Current revision (11:40, 25 December 2007) (edit) (undo) Sandman (Talk | contribs) m |
||
| (One intermediate revision not shown.) | |||
| Line 3: | Line 3: | ||
| ==Definition== | ==Definition== | ||
| - | '''INT''' Exists ( <'''INT''' processID| | + | '''INT''' Exists ( <'''INT''' processID|processTypeID> ) |
| - | Checks if a [[process]] is alive, using its [[processID]] or [[processType]]. | + | Checks if a [[process]] is alive, using its [[processID]] or checks if there is a process alive of a certain [[processType]], using its [[processTypeID]]. |
| == Parameters == | == Parameters == | ||
| {| | {| | ||
| - | | '''INT''' processID | + | | '''INT''' processID<nowiki>|</nowiki>processTypeID || - The ProcessID of the process or the ProcessTypeID of the type of processes to be checked. |
| |} | |} | ||
| Line 15: | Line 15: | ||
| '''INT''' : The result of the check | '''INT''' : The result of the check | ||
| {| | {| | ||
| - | | 0 (false) || - The process with given processID is not alive or there are no processes alive of the given | + | | 0 (false) || - The process with given processID is not alive or there are no processes alive of the given processTypeID. |
| |- | |- | ||
| - | | 1 (true) || - The process with given processID is alive or there is at least one process alive of the given | + | | 1 (true) || - The process with given processID is alive or there is at least one process alive of the given processTypeID. |
| |} | |} | ||
| Line 55: | Line 55: | ||
| </pre> | </pre> | ||
| Used in example: [[Say]]() | Used in example: [[Say]]() | ||
| + | |||
| + | {{Funcbox | ||
| + | | category = Processinteraction | ||
| + | }} | ||
Current revision
Contents |
[edit] Definition
INT Exists ( <INT processID|processTypeID> )
Checks if a process is alive, using its processID or checks if there is a process alive of a certain processType, using its processTypeID.
[edit] Parameters
| INT processID|processTypeID | - The ProcessID of the process or the ProcessTypeID of the type of processes to be checked. |
[edit] Returns
INT : The result of the check
| 0 (false) | - The process with given processID is not alive or there are no processes alive of the given processTypeID. |
| 1 (true) | - The process with given processID is alive or there is at least one process alive of the given processTypeID. |
[edit] Example
Program example;
Begin
Proc();
if(exists(id))
say("I exist!");
end
if(exists(type main))
say("I exist!");
end
if(exists(0))
say("0 doesn't exist");
end
if(exists(type proc))
say("Proc exists!");
else
say("Proc doesn't exist!");
end
Loop
frame;
End
End
Process Proc()
Begin
Loop
frame;
End
End
Used in example: Say()
| Processinteraction Functions | |
| • Advance() • Collision() • Exists() • Get_angle() • Get_dist() • Get_id() • Let_me_alone() • Signal() • Xadvance() • | |
