View Single Post
12-28-09, 04:57 AM   #7
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Originally Posted by SDPhantom View Post
That's odd, because the expression nil acts as false, so this should return "LOL" as well regardless of whether or not nil was manually assigned to the variable or table entry.

Edit: Just to make sure, I ran this through Lua and it works as I had described.
Note that if you are trying to get a value from a table while the variable is no table at all, it will always fail, even when you have an "or" set. Then you should you this:

Code:
print(type(foo)=="table" and foo.bar or "LOL")
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote