Engine:CCMD run: Difference between revisions

585 bytes added ,  15 October 2023
Line 128: Line 128:


Special parameter delimiters:
Special parameter delimiters:
:4. curly braces - for any text within a set of matching curly braces will be a single parameter, and curly braces will not be stripped.
This currently only applies in a multiline script file and does not apply in the 'global' context. This is currently used in the 'lua' and 'js' contexts to pass a multi-line code block.
:4. curly braces - Can be used to extend a whole 'statement' or set of statements across multiple lines. But will not be recognized as a parameter delimiter. The contents will be treated as one statement block.
In a script named 'startup.cfg':
<kua>
<kua>
> set bob {fred james}
alias testscript '
> bob
context lua
'bob' is '{fred james}'
{
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 ==
*
*