49
edits
(→Key) |
(→Key) |
||
| Line 14: | Line 14: | ||
** <kua>var bob fred; bob</kua> Prints 'fred'. The 'var' command is used to create a new variable, then the next statement uses the 'global' default 'varedit' command to print the value of 'bob'. 'bob' is not a command but an existing variable. | ** <kua>var bob fred; bob</kua> Prints 'fred'. The 'var' command is used to create a new variable, then the next statement uses the 'global' default 'varedit' command to print the value of 'bob'. 'bob' is not a command but an existing variable. | ||
** <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>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'. 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 returns to 'global'. Where the 'lua' context is switched to first, then the Lua command is run unqualified also using the default 'lua_edit' command. | |||
* Context - A script or command context. Each context may have its own commands and variables and rules. Examples: | * Context - A script or command context. Each context may have its own commands and variables and rules. Examples: | ||
** <kua>client start</kua> Starts the client module. | ** <kua>client start</kua> Starts the client module. | ||
** <kua>context client; start; context global</kua> Starts the client module and returns to global. | ** <kua>context client; start; context global</kua> Starts the client module and returns to global. | ||
* Command - An engine module command, also referred to as a 'CCmd'. | * Command - An engine module command, also referred to as a 'CCmd'. | ||
* Variable - An engine variable, similar to 'CVars' or config vars. | * Variable - An engine variable, similar to 'CVars' or config vars. | ||