View Single Post
08-03-18, 03:23 PM   #5
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Originally Posted by candrid View Post
If statements must end on the same "line" they start per beginning. Example here. They line up vertically. That is a "Block."
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
__________________
  Reply With Quote