View Single Post
05/30/14, 10:01 AM   #5
ingeniousclown
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 122
Originally Posted by lyravega View Post
Yeah, I'm trying to grasp my head around those stuff I am used to ternary operators from C, and just recently discovered that I can do the same with LUA's and/or stuff too (and more), which is neat

Lua Code:
  1. local alpha; alpha = allow and 0.5 or 1
  2. --if allow == true then alpha = 0.5 else alpha = 1 end
a = b ? c : d
is equal to
a = b and c or d
IFF
c is not "false" or "nil"

It's a minor but very important distinction.

Last edited by ingeniousclown : 05/30/14 at 10:03 AM.
  Reply With Quote