Files
OpenIntegrations/docs/en/examples/Lua/ExecuteBytecodeFromFile.txt
T

11 lines
524 B
Plaintext
Vendored

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!!");