Nasal library: Difference between revisions

Add createFlightplan to docs
(Add createFlightplan to docs)
Line 1,209: Line 1,209:
var (course, dist) = courseAndDistance(dest);
var (course, dist) = courseAndDistance(dest);
print("Turn to heading ", math.round(course), ". You have ", sprintf("%.2f", dist), " nm to go");
print("Turn to heading ", math.round(course), ". You have ", sprintf("%.2f", dist), " nm to go");
}}
=== createFlightplan() ===
{{Nasal doc
|syntax = createFlightplan(path);
|source = {{flightgear file|src/Scripting/NasalPositioned.cxx|l=2331|t=Source}}
|text = Creates an empty flightplan object. It accepts one argument, ''path'' passed an absolute path to a .fgfp / .xml / .gpx file, it will populate the flightplan with waypoints from the file.
|param1 = path
|param1text = Optional parameter defining the file from which a flightplan will be populated.
|example1 =
var path = getprop("/sim/fg-home") ~ "/Export/test.fgfp";
var flightplan = createFlightplan(path);
debug.dump(flightplan);
}}
}}


842

edits