in reply to Boolean counter?

I tend to use $toggle *= -1;

Update: I stand corrected, thanks LanX. I often use that for alternating rows but it's wrong here.

Replies are listed 'Best First'.
Re^2: Boolean counter?
by LanX (Sage) on Dec 07, 2009 at 23:09 UTC
    well it's a toggle but can't be used as boolean as the OP wanted , since 0*-1=0

    Cheers Rolf

Re^2: Boolean counter?
by Ratazong (Monsignor) on Mar 03, 2015 at 15:48 UTC

    Your idea works the following way - even if it doesn't look as elegant any more:

    $toggle = -1 * ($toggle - 0.5) + 0.5;
    Rata (loving this thread)