Compile code from string
Converts source code to Lua bytecode
- Parameters
- Advanced call ?
Function CompileCodeFromString(Val Lua, Val Code) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Lua | --lua | Arbitrary | ✔ | Lua AddIn or Lua version to run |
| Code | --code | String | ✔ | Source code for compilation |
Returns
BinaryData - Compilation 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
An error during code compilation will throw an exception
1C:Enterprise/OneScript code example
Result = OPI_Lua.CompileCodeFromString("Lua54", "return 1");
- Bash
- CMD/Bat
oint lua CompileCodeFromString \
--lua "Lua54" \
--code "function mul(a, b) return a * b + bonus end"
oint lua CompileCodeFromString ^
--lua "Lua54" ^
--code "function mul(a, b) return a * b + bonus end"
Result
"<Binary data>"