Evaluator: Do increment operators work on global variables?

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)