Home Manual Packages Global Index Keywords Quick Reference Language Reference Starting and Quitting Yorick Getting Help Error Recovery Array Data Types Constants Defining Variables Arithmetic and Comparison Operators Logical Operators Creating Arrays Indexing Arrays Array Conformability Rules Calling Functions Defining Functions Variable Scope Returning from Functions Compound Statements Conditional Execution Loops Function Reference I/O Reference | # Yorick Language Reference ## Conditional Execution A Yorick statement can be executed or not based on the value of a scalar condition (0 means don't execute, non-0 means execute): `if (`condition`)` statementT or, more generally, `if (`condition`)` statementT `else` statementF Several `if` statements may be chained as follows: `if (`condition1`)` statement1 `else if (`condition2`)` statement2 `else if (`condition3`)` statement3 ... `else` statementF