49
edits
| Line 17: | Line 17: | ||
While the 'lua' context has the ability to hold variables and aliases, they cannot be created from script as the 'lua' context has no 'alias', 'set' or 'var' type script commands added to the context. | While the 'lua' context has the ability to hold variables and aliases, they cannot be created from script as the 'lua' context has no 'alias', 'set' or 'var' type script commands added to the context. | ||
;Outer return statement: | ; Line by line processing: | ||
In the 'lua' context all of the script syntax rules still apply. The 'lua_edit' default command will only be run when a statement is not another context, or a command, variable, or alias. Script in the 'lua' context is still run statement by statement as script in the engine. | |||
This means that for example: | |||
<kua> | |||
context lua | |||
print(1+2); exit | |||
</kua> | |||
Would be run as: | |||
<kua> | |||
context lua | |||
print(1+2) -- sent to Lua runtime | |||
; // script statement delimiter processed in script | |||
exit // script | |||
</kua> | |||
; Outer return statement: | |||
If the outer scope of the Lua code calls return, the return values will be printed. For example: <kua> | If the outer scope of the Lua code calls return, the return values will be printed. For example: <kua> | ||
context lua | context lua | ||