---
sidebar_position: 1
description: Compile code from string and other functions to work with Lua in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Lua]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Admonition from '@theme/Admonition';
# Compile code from string
Converts source code to Lua bytecode
`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
Advanced call{' '} e.stopPropagation()}>?}>
| 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
:::
```bsl title="1C:Enterprise/OneScript code example"
Result = OPI_Lua.CompileCodeFromString("Lua54", "return 1");
```