LUA is a dynamic, reflective, imperative and procedural programming language used as a general purpose scripting language.
Lua was created in 1993 by Roberto Ierusalimschy, Luiz Henrique de Figueiredo and Waldemar Celes, members of Tecgraf / PUC-RIO, the group of Technology em Computação Gráfica at the Pontifical Catholic University of Rio de Janeiro, Brazil. Versions of Lua prior to version 5.0 were released under a license similar to the zlib license. Since version 5.0 Lua has been released under MIT license. In an article published in Dr. Dobb's Journal, the creators of Lua claimed that Lisp and Scheme with their typical data structure, the list, had the greatest influence on the decision to adopt the table as the primary data structure in Lua. Lua has been used in many commercial and non-commercial applications. (Lua, s.d.)
Characteristics of language
The main features of Lua are the functions seen as first level "objects", assignable to variables, and the use of tables as generic data structures.
These particularities allow the language to implement features seen in object-oriented languages without it being the same. (Lua, s.d.)
The choice to use Lua as a sub language for Nios4 derives from the important peculiarity of being available for all the devices of the platform, allowing to distribute and operate these subprograms on the managed operating systems.
These subprograms (script from now on) are automatically performed by Nios4 at key points of its operation, such as pre-save and post-save. Other scripts can be real commands that the user can use.
Scripts can be linked to a data table or to the program. Linked to the data, they are divided into two categories: the scripts that will be executed when the data are displayed in the tab and those that are managed within an editing grid.
Lua functions and object of Nios4have been created to be available on all devices even if, depending on the operating system, there may be different responses and operations.
An example: the reading of GPS points works on iOS and Android, while on the other systems a pair of zeros is always returned.
Another difference is related to saving any files, in fact iOS devices have a different file management than the others.
It is therefore recommended to test the scripts on all devices to avoid possible malfunctions.
To create a new script or modify an existing one: open the appropriate page in the Options section. Remember that you need to have database administrator permissions to be able to manage scripts.