The snippet you show can be done without white space
Will work but is not pretty, remember that white space in this language is a lot like C code and is for human readability.Code:local i = 1 while a[i] do print(a[i]) i = i + 1 end
Another thing to remember is that LUA, in the way WoW uses it and I suspect that LOTRO will use it, is not a compiled language and it behaves just like a shell script would in Bash for example. It is why when you look at addons in WoW (The code) you tend to have all functions at the top.
Indentation is what usually will screw up a C/C++ coder who starts to learn Python.
C and other languages that use ';' for the end of code lines, it is used by the compiler when it turns the code into object form. C for example will strip out all white space the is not explicitly inside quotes or () before it does starts to actually compile the code.
EDIT: One quick note, the ';' can be used like in C but is optional. Just checked the LUA Manual.
Yes, but his is far more readable.
Ujest - 140 Lore-master, Opun Tia – 107 Warden, Tummi - 105 Captain, Veneur - 75 Hunter, Cneasai - 66 Minstrel, plus alts and mules
Officer, Pipeweed and Ale, Arkenstone (formerly – Friends of Frodo, Vilya)
and Star Citizen…
This form's session has expired. You need to reload the page.
Reload