Constant Expression Examples

The Constant Expression option allows you to enter an OpusScript expression in the box. An expression is a line of code that returns a result e.g. Score = 6 + 4 – the return value is 10. A constant expression is a line of code that does not calculate a result but is already a result e.g. Score – the return value is the value contained in Score.

You can only enter a constant expression in this option. Below are valid constant expressions:

image\Insert_Variable_Dialog_Expression_Example_1.jpg

image\Insert_Variable_Dialog_Expression_Example_2.jpg

The illustration on the left shows an OpusScript variable – the value contained in the variable Fullname will be displayed in the Text object to the user.

The illustration on the right combines a string (i.e. text surrounded by quote marks) with the element of an Array variable appended to the end (i.e. the + sign) – if the element Score[0] had the value Einstein, then the return value of this expression in the Text object to the user would be:

Your answer is Einstein

Close