Arbortext Command Language > Using the Arbortext Command Language > Variable Assignment and Relation
  
Variable Assignment and Relation
By default variable does not need a special declaration. It is declared when you assign a value to it.
* 
You can use the _STRICT_ predefined variable to force ACL to require that all variables in a package are explicitly declared. See Predefined variables for details.
There are three types of variables in ACL: integer, string, and character. Each variable type is preceded by a dollar sign ($).
Below is an example of each variable type:
$counter=5
The variable is an integer.
$name="Peter"
The variable is a string.
$char="c"
The variable is a character.
* 
The initial value of every variable (that is, the value of an unassigned variable) is the null string ("").
ACL allows variable assignments that are similar to those used in the C programming language. For example:
$i += 2
is equivalent to
$i = $i + 2
$i -= 2
is equivalent to
$i = $i - 2
$i *= 2
is equivalent to
$i = $i * 2
$i /= 2
is equivalent to
$i = $i / 2
$i %= 2
is equivalent to
$i = $i % 2
Note that “/” is a division operator that uses integer arithmetic. This means that if $a==5, the result of $a/3 is 1, not 1.6667.
The percent sign (%) is an operator that outputs the remainder of division arithmetic; thus, if $a==5, the result of $a%3 is 2.
ACL also allows abbreviated notation for increment operations. Here are some examples:
$i = ++$n
is equivalent to
$n=$n+1; $i = $n;
$i = $n++
is equivalent to
$i = $n; $n = $n+1
$i = -- $n
is equivalent to
$n=$n-1; $i = $n
$i = $n --
is equivalent to
$i = $n; $n = $n-1