If (MPI)
From Tapestries MUCK
(Difference between revisions)
(added another example) |
|||
(3 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
- | [[Category: | + | [[Category:functions (MPI)]][[Category:Logical Functions (MPI)]] |
=if= | =if= | ||
<mpi>{if:check,true} | <mpi>{if:check,true} | ||
Line 9: | Line 9: | ||
If there is no false argument, and 'check' evaluated false, then it returns a null string. | If there is no false argument, and 'check' evaluated false, then it returns a null string. | ||
- | + | Examples: | |
<mpi>Your computer is {if:{eq:2,3},broken!,all right.}</mpi> | <mpi>Your computer is {if:{eq:2,3},broken!,all right.}</mpi> | ||
+ | <mpi>{if:{eq:{awake:{owner:this}},1},awake,asleep}</MPI> |
Latest revision as of 21:50, 24 April 2007
if
{if:check,true} {if:check,true,false}
This is a simple conditional command. It evaluates the 'check' argument and if it is true, then it evaluates the 'true' argument and returns it's result.
If 'check' does not evaluate as true, then it will evaluate the 'false' argument, if there is one, and returns it's result.
If there is no false argument, and 'check' evaluated false, then it returns a null string.
Examples:
Your computer is {if:{eq:2,3},broken!,all right.}
{if:{eq:{awake:{owner:this}},1},awake,asleep}