Evaluator: Do increment operators work on global variables?

Normal variables can be incremented like this:

c++

But it doesn't work for global variables:

$glob:c++

They need to be incremented like this:

$glob:c = $glob:c + 1

Is my observation correct or is my syntax wrong?

Fixed in the next update.

2 Likes

This works fine in the Ad-Hoc window:

$glob:counter=7;
Output($glob:counter);

$glob:counter=$glob:counter+1;
Output($glob:counter);

++$glob:counter;
Output($glob:counter);

$glob:counter++;
Output($glob:counter);

However, I can't get it to work with a function button:

=$glob:counter=7
=Output($glob:counter)

=$glob:counter=$glob:counter+1
=Output($glob:counter)

=++$glob:counter
=Output($glob:counter)

=$glob:counter++
=Output($glob:counter)

Hopefully fixed in the next update!

1 Like