Login to WatchAwear



Similarly, you shouldn't need a function to toggle a variable between two values. You shouldn't have to say “if var_x==1 then var_x=0 else var_x=1 end” or something (assuming var_x is always either 0 or 1). This is sufficient:


You can modify that if you're toggling between 1 and 2 (var_x=3-var_x) etc. If you're using a boolean variable (one that is either true or false, not a numerical value), you can just say:

var_x=not var_x

(and whatever you do, don't say things like “if var_x==true” or “if var_x==false”. Just “if var_x” and “if not var_x”. Testing a boolean for equality to true/false is redundant.)

Published by Mark Shoulson on 27 August 2015WatchMaker Tips & Tricks Posted

Download the
'WatchAwear - Resources for WatchMaker' App

WatchAwear - Companion for WatchMaker

Download The Best Watch Designing App
for Wear OS, and Tizen:

WatchMaker Beautiful Watches for Android Wear

No smartwatch required!!
Best clock wallpaper for Android!

WatchMaker Live WallPaper