Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter ThreeData Types and Operators (continued)

3.13 Assignment

3.13.1 Setting a Variable

The basic assignment operator is “=”. The first inclination might be to think of this as “equal to” (equal to is expressed as “==”). It really means that the left operand gets set to the value of the expression on the right (that is, “gets set to”). The left side of an assignment expression is considered the “l-value” while the right side is the “r-value”. L-values must always be a variable.

As a shortcut, certain math operations can be combined. For example:

a = a * 6;

 

is the same as

a *= 6;

 

Assignment is always the last step in an expression.

3.13.2 Assignment Types

The following table expresses the types of assignments and the types of data allowed.

Operator Description Integer Float String Handle Cluster
= Assign x x x x x
+= Add and assign x x x x
-= Subtract and assign x x x
*= Multiply and assign x x x
/= Divide and assign x x x
%= Modulo and assign x x
|= Logical OR and assign x x
&= Logical AND and assign x x
^= Logical XOR and assign x x
.= Concatenate as assign x x

The cluster types are only allowed if the variables are compatible and they can be arrays or structures.