mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-06-20 09:19:27 +02:00
67 lines
2.1 KiB
Plaintext
Vendored
67 lines
2.1 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 4
|
|
|
|
description: Execute bytecode from file 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';
|
|
|
|
# Execute bytecode from file
|
|
Executes bytecode from the specified file
|
|
|
|
|
|
|
|
<Tabs>
|
|
<TabItem value="params" label="Parameters" default>
|
|
|
|
`Function ExecuteBytecodeFromFile(Val Lua, Val Path) Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| Lua | --lua | Arbitrary | ✔ | Lua AddIn or Lua version to run |
|
|
| Path | --path | String | ✔ | Path to file with bytecode |
|
|
|
|
|
|
<div className="return-value-note">
|
|
<div className="return-value-note__title">Returns</div>
|
|
<div className="return-value-note__value">
|
|
Arbitrary - Execution result
|
|
</div>
|
|
</div>
|
|
|
|
</TabItem>
|
|
<TabItem value="extended" label={<span>Advanced call{' '}<a href="/docs/Start/Advanced-call" target="_blank" rel="noreferrer" title="About advanced call" onClick={(e) => e.stopPropagation()}>?</a></span>}>
|
|
|
|
| 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) |
|
|
|
|
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
ScriptFile = GetTempFileName("lua");
|
|
GetBinaryDataFromString("return 13").Write(ScriptFile);
|
|
|
|
BytecodeFile = GetTempFileName("bin");
|
|
Bytecode = OPI_Lua.CompileCodeFromFile("Lua54", ScriptFile);
|
|
Bytecode.Write(BytecodeFile);
|
|
|
|
Result = OPI_Lua.ExecuteBytecodeFromFile("Lua54", BytecodeFile);
|
|
|
|
OPI_Tools.RemoveFileWithTry(ScriptFile , "Failed to delete the temporary file after the test!!");
|
|
OPI_Tools.RemoveFileWithTry(BytecodeFile, "Failed to delete the temporary file after the test!!");
|
|
```
|
|
|
|
|
|
|
|
|
|
|