Stewart Andreason wrote: > Is there a preference for how variables are declared and used in nasal? > between the global type: > var some_name = 0; > which can be accessed and changed from any function,
That's a Nasal variable. It's not "global" in the sense that all users will see the same value for "name". It's part of the namespace of the executing function (which might be the whole file), and is visible only to the current function, and other "func" expressions assigned during that execution. > and using the nodes > var name = > props.globals.getNode("/sim/model/aircraftName/someDirectory/name",1); > and accessing with .getValue and .setValue. That's *also* a Nasal variable, but it holds a reference to a property node instead of an actual value. Interestingly, the property node, unlike the variable above, *is* a global thing (i.e. every part of FlightGear sees the same node for /sim/model/.../name). The advantage to Nasal-space data is that it's fast and simple. If the only thing that will care about the value is your script, they are good choices. The property tree is a inter-subsystem communication thing. This is what you want if you want to share data with the C++ world (for example, YASim <control-output> tags write to properties -- they don't understand Nasal), or read in via configuration files. Andy ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel