49
edits
| Line 128: | Line 128: | ||
Special parameter delimiters: | Special parameter delimiters: | ||
:4. curly braces - | 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> | ||
alias testscript ' | |||
> bob | 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 == | ||
* | * | ||