Call byte code function
Executes bytecode and calls the specified function
- Parameters
- Advanced call ?
Function CallByteCodeFunction(Val Lua, Val Bytecode, Val FunctionName, Val Parameters = Undefined, Val Packages = Undefined, Val Variables = Undefined) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Lua | --lua | Arbitrary | ✔ | Lua AddIn or Lua version to run |
| Bytecode | --code | String, BinaryData | ✔ | Byte code or file path |
| FunctionName | --func | String | ✔ | Function name or path in module.func format |
| Parameters | --params | Map Of KeyAndValue | ✖ | Function parameters, if necessary |
| Packages | --packages | Map Of KeyAndValue | ✖ | Packages: key > name, value > code or file path |
| Variables | --globals | Map Of KeyAndValue | ✖ | Module global variables, if necessary |
Returns
Arbitrary - Calling result
| Parameter | Description |
|---|---|
| addin_mode | Manual selection of external component connection mode (for 1C): Isolated, NotIsolated |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
tip
Similarly to separate calls of ExecuteByteCode, AttachPackageFromString, SetGlobalVariable, and CallFunction
Parameters with Binary data type can also accept file paths on disk and URLs
1C:Enterprise/OneScript code example
Bytecode = OPI_Lua.CompileCodeFromString("Lua54", "function sub(a, b) return a - b end");
Parameters = New Array;
Parameters.Add(10);
Parameters.Add(3);
Result = OPI_Lua.CallByteCodeFunction("Lua54", Bytecode, "sub", Parameters);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint lua CallByteCodeFunction \
--lua "Lua54" \
--code "/tmp/nqjoas5n.ymg" \
--func "mul" \
--params "['6','7']" \
--globals "{'bonus':'2'}"
:: JSON data can also be passed as a path to a .json file
oint lua CallByteCodeFunction ^
--lua "Lua54" ^
--code "/tmp/nqjoas5n.ymg" ^
--func "mul" ^
--params "['6','7']" ^
--globals "{'bonus':'2'}"
Result
7