in reply to Tk starting and stopping an autoplay loop using a keybinding
The ternary operator ?: is not a statement but an expression. You should assign its result, not run two statements:
$toggle_autoplay = ($toggle_autoplay == 0) ? 1 : 0;
or, a bit shorter:
$toggle_autoplay = !$toggle_autoplay;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tk starting and stopping an autoplay loop using a keybinding
by tybalt89 (Monsignor) on Oct 03, 2016 at 18:48 UTC | |
|
Re^2: Tk starting and stopping an autoplay loop using a keybinding
by Discipulus (Canon) on Oct 03, 2016 at 08:23 UTC |