📄️ Statements
irScript statements form the core structure of the language; as in other languages, statements dictate control of flow and define the overall algorithm of a code block. Valid irScript statements are always followed with a semi-colon (';').
📄️ Statement blocks
irScript statement blocks are enclosed by opening/closing curly braces ({' and '}) and form a variable declaration scope; that is, variables declared within a statement block are local to that block and available to any child statements blocks declared within the original block.
📄️ break
A irScript break statement is used to immediately stop execution inside a for statement, while statement, do/while statement, or switch statement; execution continues with the statement immediately following the enclosing statement, if any:
📄️ continue
irScript continue statement is used to immediately stop execution inside a for, do/while, or
📄️ do/while
A irScript do/while statement is used to iteratively execute a statement block, such that at least one iteration occurs and subsequent iterations occur in response to positive outcome of some conditional test:
📄️ for
For statements are loops that take one of two forms: a C# foreach-style iterator over a collection, or a traditional C#-style for loop.
📄️ if
If statements provide support for conditional branching and flow control. As in most languages, if statements can be followed by an optional else statement, executed if the original condition is not met.
📄️ return
A return statement in irScript is used to exit a function and, optionally, specify a return value.
📄️ switch
A switch statement in irScript has similar syntax and semantics to switch in C#:
📄️ throw
A irScript throw statement is used to raise an error from the current point of execution. Such
📄️ try/catch/finally
irScript try/catch/finally blocks are used to implement error handling logic. A try block may be accompanied by a single catch block, a single finally block, or both; it cannot appear by itself:
📄️ while
irScript supports conditional while loops, where the body of the loop executes until a specified condition is met (or a break statement is encountered):