Talk:Nasal scripting language

From FlightGear wiki
Revision as of 17:11, 13 October 2011 by Hooray (talk | contribs) (→‎Usage: added)
Jump to navigation Jump to search

Contents that need to be incorporated

Todo

  • mention/explain nil
  • shorthand ops: += *= ~= /=
  • operator precedence, prioritizing expressions using parentheses
  • multi-assignments don't work as expected for functions with multiple return values

Mailing List Discussions

Usage

Features

Nasal Modules

Moving to Nasal Modules.

setprop() functionality

setprop() 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 instrumentation/cdu/page[4]/title = 'MENU' (string). Hcc23