The Calculator
AXE's calculator window is a handy way of accessing the expression evaluator
for general-purpose calculation.
The calculator is a simple but brawny tool that runs an expression and shows
you the variables and the expression's result. The syntax of AXE's C-like
expressions is described here
.
The Expression window is a text area for you to enter an expression
in. For example, to use a fairly unlikely example, you might enter
a = 10;
count=0;
for (i=2; i <= (a/2); i+=1)
{
if (a/i == floor(a/i))
{
factors[count] = i;
}
}
count;
...to count the factors of a and store them in the factors
array.
The Result window shows the result of the last evaluation. In this
case the last statement is just count; so the value of count
is the result.
The Variables window shows the variables that were defined at the end
of the last evaluation. In this case it would look like this:
a = 10;
count = 2;
factors[000] = 2;
factors[001] = 5;
i = 6;
When the expression is evaluated these variables are added back in; in other
words, the next calculation will be able to refer to them.
The Clear button clears the variables away, in case you want the next
calculation to make a fresh start.
The Evaluate button evaluates the expression.
The calculator remembers whatever expression is in it when you close the window,
so you don't lose your expression.