Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

The integrated LUA script engine also provides the opportunity to split the LUA implementation into separate source files. Using this way, it is possible to implement user-defined LUA functions that can be reused in other NETx BMS Core Server projects. In addition it keeps the LUA source code short, clearly arranged, and easy to maintain.
User-defined LUA script files have to be stored within the script directory of the workspace directory. To reuse a LUA script file, it has to be imported within the standard LUA file "nxaDefinitions.lua" by using the key work "require".
Example: require "MyLuaScriptFile"
This code line includes the file "MyLuaScriptFile.lua" into the default LUA script file – thus all functions that are defined there are available within the whole script engine. Note that is has to be ensured that a function name is used only once.
In order to load a previously encrypted LUA script us the nxa.LoadXLuaLibrary function:

Description - INTERNAL DOCUMENTATION

Signature

nxa.LoadXLuaLibrary (filename)

This function loads a LUA script that was previously encrypted using the NETx LUA Protector and makes its containing functions available.

Parameters

NameTypeMandatory/OptionalDescription
 filenameMthe filename with extension that will be looked for in the workspace's ScriptFiles directory

Return

None.

  • No labels