View Single Post
08-03-18, 03:43 PM   #6
candrid
Premium Member
 
candrid's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 61
Originally Posted by MunkDev View Post
Lua Code:
  1. -- ...
  2.     if (returnView) then -- An if statement is like a true and false, a yes or no.
  3.         SaveView(5)
  4.     end -- If statements must end on the same "line" they start per beginning. Example here. They line up vertically. That is a "Block."

No, they don't. end means it's the end of the scope, but Lua is not sensitive to indentation. You can just as easily write your entire addon on one line and it would still work, just be a clusterfuck to read and understand.

Lua Code:
  1. if (returnView) then SaveView(5) end
Thank you! I did not know that.
  Reply With Quote