You can control the scope of script execution by grouping statements into a block. The contents of a group cannot be referenced outside of the block.
Grouping commands is useful if you want to:
...
if (test condition) { statement_1; statement_2; } |
For example:
Code Block |
---|
|
if ( 2 < 3 )
{
string $blah = "This worked";
print ($blah);
} |
Grouping examples
This example groups the statement to be executed for an IF conditional statement:
Code Block |
---|
|
float $MasterControl = 1; |
...
float $MarkerControl = 1; |
...
if ($MasterControl == 1 || $MarkerControl == 1) |
...
...
...
...
...
print ("Operation was run."); |
...