Statement blocks

  • Updated

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.

Statement blocks contain one or more statements, executed in sequence:

var x = 45;
var x = 22.3; /ERROR: ‘x’ already declared

var y = 67;

var z = y; // ERROR: ‘y’ not currently in scope

An implicit global statement block exists for every irScript instance; this global block is not
surrounded by curly braces.

Was this article helpful?

0 out of 0 found this helpful



Please sign in to leave a comment.