5
Vote

Lua versus other programming languages

If you know one or more programming languages, Lua is easy to learn. Here are a things which are different in Lua: 1. If A then B or C This us how an if then clause usually look like. In a WM property (like Opacity) you would use the following Lua syntax: A and B or C Note: If A is a condition like A1 and A2 you need to use brackets to help Lua understand it: (A1 and A2) and B or C 2. In the main script you can write functions like this: function myfunc(parameter1, parameter2) If parameter1 == 1 then return 10 elseif parameter2 == 2 then return 5 end end Here you can see how an if else clause looks like in a Lua function (note the elseif keyword). 2. A comment begins with two - characters 3. Unequal operator in Lua is ~=

Published by Roland Scholz on 28 August 2015WatchMaker Tips & Tricks Posted

This Website and It's Resources are Powered by:
  
WatchMaker Beautiful Watches for Android Wear

No smartwatch required!! Best clock wallpaper for Android!
  
WatchMaker Live WallPaper

Introducing the Perfect Companion App for WatchMaker...
  
GearsPro (OBD 2 & Car)