Eyeon:Script/Tutorials/Console Introduction/Multiple Lines in Console
From VFXPedia
Lesson 1.3 : Multiple Lines
If you ever need to input multiple lines of code in the console, the operation is fairly simple. In Lua, the semicolon character (;) is used to break up chunks of code ( http://www.lua.org/pil/1.1.html), but the character is not needed to input multiple lines into the console.
There are also certain cases where the semicolon will provoke error messages -- generally it's best to forego them and type everything on the same line.
For example:
x=0 x=x+1 print(x) x=composition:GetAttrs() dump(x) x = nil if x == nil then print("x is nil") end 1 . . . x is nil
This is useful if you ever need to perform more complex pieces of code in the console. At this point, it is generally hoped that you understand the core concepts behind Lua's implementation of the For, If, While and Repeat statements and other aspects of programming.
The above example is trivial. What if you needed a general text dump of all the attributes of every input on a tool.
inputList = Loader1:GetInputList() for i, entry in inputList do dump(entry:GetAttrs()) end
For the purposes of further lessons, inputting long strings of code into the console will not be used. Instead, we now move onto our next section: Composition scripts.
Tips for Multiple Lines in Console (edit)
EyeonTips:Script/Tutorials/Console Introduction/Multiple Lines in Console
