Execute code from string
Executes Lua code from the passed string
- Parameters
- Advanced call ?
Function ExecuteCodeFromString(Val Lua, Val Code) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Lua | - | Arbitrary | ✔ | Lua AddIn or Lua version to run |
| Code | - | String | ✔ | Code as string |
Returns
Arbitrary - Code execution result
| Parameter | Description |
|---|---|
| addin_mode | Manual selection of external component connection mode (for 1C): Isolated, NotIsolated |
tip
An error during Lua code execution will throw an exception
Caution
NOCLI: this method is not available in CLI version
1C:Enterprise/OneScript code example
Result = OPI_Lua.ExecuteCodeFromString("Lua54", "return 42");
Result
42