49
edits
(→Key) |
(→Key) |
||
| Line 11: | Line 11: | ||
* 'Global commands' and 'Global variables' - below are short-hand for commands placed in the 'global' context. | * 'Global commands' and 'Global variables' - below are short-hand for commands placed in the 'global' context. | ||
* 'Default command' - is run by default if its context is addressed by name or is the current context. Examples: | * 'Default command' - is run by default if its context is addressed by name or is the current context. Examples: | ||
** <kua>bob james; bob</kua> Prints 'james'. | ** <kua>bob james; bob</kua> Prints 'james'. In the first statement, the global default command 'varedit' finds the existing 'bob' variable in the 'global' context, and assigns 'james'. In the next statement, the default command finds and prints the value of variable 'bob'. | ||
** <kua>lua print(1 + 3)</kua> Prints 3. | ** <kua>lua print(1 + 3)</kua> Prints '3'. The 'lua' context is addressable from 'global'. The default command 'lua_edit' in the 'lua' context, runs the lua statement in the Lua runtime, where the 'print' is a real Lua statement, not an Engine script one. | ||
** <kua>context lua; print(1 + 3); exit</kua> Also prints 3 and return to global. Where context is switched to, then the Lua command is run. | ** <kua>context lua; print(1 + 3); exit</kua> Also prints 3 and return to global. Where context is switched to, then the Lua command is run. | ||
** <kua>client start</kua> Starts the client module. | ** <kua>client start</kua> Starts the client module. | ||