Don't modify a variable that you're using elsewhere in an expression. At best, it's unclear. At worse, the result is undefined.
should be$toggle = - --$toggle;
which can be shortened to previously mentioned$toggle = -( $toggle - 1 );
$toggle = 1 - $toggle;
In reply to Re^3: Boolean counter?
by ikegami
in thread Boolean counter?
by DreamT
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |