Get global variable
Gets the value of a global variable in the context
- Parameters
- Advanced call ?
Function GetGlobalVariable(Val Lua, Val Name) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Lua | - | Arbitrary | ✔ | Lua AddIn or Lua version to run |
| Name | - | String | ✔ | Variable name |
Returns
Arbitrary - Variable value
| Parameter | Description |
|---|---|
| addin_mode | Manual selection of external component connection mode (for 1C): Isolated, NotIsolated |
Caution
NOCLI: this method is not available in CLI version
1C:Enterprise/OneScript code example
Lua = OPI_Lua.CreateVM("Lua54");
OPI_Lua.SetGlobalVariable(Lua, "test_var", 99);
Result = OPI_Lua.GetGlobalVariable(Lua, "test_var");
Result
99