Nasal library: Difference between revisions

Jump to navigation Jump to search
Update first paragraph
(→‎Variables: Doc global variables. Feel free to fix any typos I haven't spotted.)
(Update first paragraph)
Line 1: Line 1:
{{Nasal Navigation}}
{{Nasal Navigation}}
This page documents the '''library functions''' of FlightGear's built-in scripting language, [[Nasal]]. This includes ''[[#Core library functions|core library functions]]'', which were included in Nasal before its integration into FlightGear, and ''[[#Extension functions|extension functions]]'', which have been subsequently added, and are specifically designed for FlightGear. The relevant folders in [[Git]] are:
This page documents the global '''library functions and variables''' of FlightGear's built-in scripting language, [[Nasal]]. This includes ''[[#Core library functions|core library functions]]'', which were included in Nasal before its integration into FlightGear, the ''[[#Extension functions|extension functions]]'', which have been subsequently added, and are specifically designed for FlightGear, and the ''[[#variables|global variables]]'', which are conversion variables for converting between units added with extension functions. The relevant folders in [[Git]] are:
* {{flightgear file|src/Scripting}}
* {{flightgear file|src/Scripting}}
* {{simgear file|simgear/nasal}}
* {{simgear file|simgear/nasal}}


All these functions and variables are in the global namespace, that is, they are directly accessible (e.g., one can call <syntaxhighlight lang="nasal" inline>magvar()</syntaxhighlight> in stead of <syntaxhighlight lang="nasal" inline>namespace.magvar()</syntaxhighlight>). For a more complete explanation, see [[Nasal Namespaces in-depth]].
All these functions and variables are in the global namespace, that is, they are directly accessible (e.g., one can call <syntaxhighlight lang="nasal" inline>magvar()</syntaxhighlight> instead of <syntaxhighlight lang="nasal" inline>namespace.magvar()</syntaxhighlight>). For a more complete explanation, see [[Nasal Namespaces in-depth]].


{{tip|Copy & paste the examples into your [[Nasal Console]] and execute them to see what they do.|width=70%}}
{{tip|Copy & paste the examples into your [[Nasal Console]] and execute them to see what they do.|width=70%}}

Navigation menu