Compile code from file
Converts a source code file to Lua bytecode
- Parameters
- Advanced call ?
Function CompileCodeFromFile(Val Lua, Val Path) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Lua | --lua | Arbitrary | ✔ | Lua AddIn or Lua version to run |
| Path | --path | String | ✔ | Script file path |
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
ScriptFile = GetTempFileName("lua");
GetBinaryDataFromString("return 3").Write(ScriptFile);
Result = OPI_Lua.CompileCodeFromFile("Lua54", ScriptFile);
- Bash
- CMD/Bat
oint lua CompileCodeFromFile \
--lua "Lua54" \
--path "/tmp/2nk41af0.hvl.lua"
oint lua CompileCodeFromFile ^
--lua "Lua54" ^
--path "/tmp/2nk41af0.hvl.lua"
Result
"<Binary data>"