Talk:Nasal scripting language: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (→‎Usage: added)
m (→‎setprop() functionality: moved comments to main article (thanks hcc23!))
Line 35: Line 35:


Moving to [[Nasal Modules]].
Moving to [[Nasal Modules]].
== <tt>setprop()</tt> functionality ==
<tt>setprop()</tt> concatenates a list of input arguments by means of inserting a "/" in between. That is nice for properties, as this slash is part of the tree. However, when one wants to make use of indices, like [0], one has to concatenate by hand (using "~") ''inside'' one part of the string argument list. An example is:
  var i = 4;
  setprop("instrumentation","cdu","page["~i~"]","title","MENU");
This results in <code>instrumentation/cdu/page[4]/title = 'MENU' (string)</code>.
[[User:Hcc23|Hcc23]]

Revision as of 11:25, 15 October 2011