Engine:CCMD run: Difference between revisions

854 bytes removed ,  16 October 2023
Line 152: Line 152:
> bob
> bob
'bob' is 'fred james'
'bob' is 'fred james'
</kua>
==== Special parameter delimiters: ====
:4. curly braces - Can be used to extend a whole 'statement' or set of statements across multiple lines. Can not be used as a parameter delimiter. The contents will be treated as one statement block. 
::''Note: Only useful in a multiline script file, and only works for default commands, like in the 'lua' and 'js' contexts, to pass a multi-line code block to the default command, for passing to the Lua and JS runtimes.''
In a script named 'startup.cfg':
<kua>
alias testscript '
context lua
{
print("Lua")
local s = ""
for i = 10, 1, -1 do
s = s .. i .. " "
end
io.write(s)
print("print bob"..s)
}
exit
context js
{
print("JavaScript");
var s = "";
for (i = 10; i >= 1; i--) s += i + " ";
print(s);
//script("print bob" + s);
//return 0;
}
exit
'
bind U testscript
</kua>
</kua>


== Notes ==
== Notes ==
*
*