2,732
edits
Red Leader (talk | contribs) (→stat()) |
Red Leader (talk | contribs) (Start write_properties()) |
||
Line 364: | Line 364: | ||
=== write_properties() === | === write_properties() === | ||
Write XML file in FlightGear's native <PropertyList> format. | {{Nasal doc | ||
Returns the filename on success or nil on error. If the source is a props.Node that refers to a node in the main tree, | |syntax = io.write_properties(path, prop); | ||
then the data are directly written from the tree, yielding a more accurate result. | |text = Write XML file in FlightGear's native <PropertyList> format. Returns the filename on success or nil on error. If the source is a props.Node that refers to a node in the main tree, then the data are directly written from the tree, yielding a more accurate result. Otherwise the data need to be copied first, which may slightly change node types (FLOAT becomes DOUBLE etc.) | ||
Otherwise the data need to be copied first, which may slightly change node types (FLOAT becomes DOUBLE etc.) | |param1 = path | ||
|param1text = | |||
|param1 = prop | |||
|param1text = | |||
|example1 = var data = props.Node.new({ a:1, b:2, c:{ d:3, e:4 } }); | |||
var data = props.Node.new({ a:1, b:2, c:{ d:3, e:4 } }); | |||
io.write_properties("/tmp/foo.xml", data); | io.write_properties("/tmp/foo.xml", data); | ||
io.write_properties("/tmp/foo.xml", "/sim/model"); | io.write_properties("/tmp/foo.xml", "/sim/model"); | ||
}} | |||
=== writexml() === | === writexml() === |