Basic
The Basic category includes three types of Script Instructions.
Evaluating an expression
Block Structures
Comments
Expression Eval: is a Basic Instruction that executes a JavaScript expression and stores the result in a Local Variable.
To construct a Script Instruction using
:Select
from the dropdown list. Options and appear as seen below.Enter the name of the Local Variable and the JavaScript Expression in the respective fields.
In the below example:
The Local Variable updatedCount holds the Expression var(deviceCount) + 10;
The
Script Instruction is added to the Script.
At runtime, if the value of deviceCount is 5, then this Script Instruction executes the Expression ( deviceCount + 10 = 5 + 10 ) and stores the value of 15 in the Local Variable updatedCount.
Note
can be also used to evaluate string and logical expressions.
Block {...} : {...} adds structure to the Script. A Block holds a set of Script Instructions.
Note
The Block Structure { ... } also defines the scope of a Local Variable. A Local Variable defined inside a Block is only accessible to Script Instructions within the same Block.
To create a Block Structure:
Select
from the dropdown list.A Block Structure appears in the Script.
You can add new Script Instructions to the Block by clicking the
button. You can remove the Block by clicking the
button.
Using the Block Structure, you can organize the Script in a logical manner.
In the below example, note that the Script has been organized into Blocks.
![]() |
Comment // ... : // ... adds a non-executable statement to the Script. It can be used to add helpful notes and explanations to the Script.
Adding Comments increases the readability of the Script. You can add as many Comments as required.
To add a Comment:
Select
from the dropdown list.Enter the comment in the
field.
A comment is added to the Script. Comments are usually added to provide information related to the other Instructions in the Script as seen below:
![]() |