IfElse
From M.U.G.E.N Wiki
Trigger: IfElse (math)
This trigger takes three arguments. If the first is nonzero, IfElse returns the value of the second argument. Else, it returns the value of the third argument. All arguments are evaluated prior to execution of ifelse.
- Format:
- IfElse(exp_cond,exp_true,exp_false)
- Arguments:
- exp_cond
- Expression to test.
- exp_true
- Expression specifying value to return if exp_cond is nonzero.
- exp_false
- Expression specifying value to return if exp_false is zero.
- Return type:
- Type of exp_true or exp_false, whichever is returned.
- Error conditions:
- Returns SFalse if any of the arguments evaluate to SFalse.
Example:
value = ifelse(var(3),1,2) Sets value to 1 if var(3) is not zero, and sets value to 2 if var(3) is 0.