2,732
edits
Red Leader (talk | contribs) (Start write_properties()) |
Red Leader (talk | contribs) (→write_properties(): More doc) |
||
Line 366: | Line 366: | ||
{{Nasal doc | {{Nasal doc | ||
|syntax = io.write_properties(path, prop); | |syntax = io.write_properties(path, prop); | ||
|text = | |text = Writes nodes from the [[Property Tree]] to an XML file in FlightGear's [[PropertyList XML files|PropertyList]] format. Returns the filename on success or <code>'''nil'''</code> on error. | ||
|param1 = path | |param1 = path | ||
|param1text = | |param1text = Path of the file to write to. | ||
|param1 = prop | |param1 = prop | ||
|param1text = | |param1text = Either a property path or a <code>props.Node</code> object. Note that, when the latter is used, results will be more accurate if it refers to a node in the Property Tree, otherwise the node will have to be copied, which may change the node type. | ||
|example1 = var data = props.Node.new({ a:1, b:2, c:{ d:3, e:4 } }); | |example1 = 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); |