Nasal library: Difference between revisions

Line 1,480: Line 1,480:
}}
}}


===findNavaidByFrequency()===
===findNavaidByFrequencyMHz()===
{{Nasal doc
{{Nasal doc
|syntax = findNavaidByFrequency([pos, ]freq[, type]);
|syntax = findNavaidByFrequencyMHz([pos, ]freq[, type]);
|source = {{flightgear file|src/Scripting/NasalPositioned.cxx|l=1547|t=Source}}
|source = {{flightgear file|src/Scripting/NasalPositioned.cxx|l=1547|t=Source}}
|text = Returns a <code>navaid</code> ghost object for a navaid matching a given frequency. If there is more than one navaid with that frequency, the nearest station is returned.
|text = Returns a <code>navaid</code> ghost object for a navaid matching a given frequency. If there is more than one navaid with that frequency, the nearest station is returned.
Line 1,495: Line 1,495:
|param3 = type
|param3 = type
|param3text = This will narrow the search to navaids of a certain type. Defaults to "all." For the full list of accepted type arguments, see {{flightgear file|src/Navaids/positioned.cxx|l=127}}.
|param3text = This will narrow the search to navaids of a certain type. Defaults to "all." For the full list of accepted type arguments, see {{flightgear file|src/Navaids/positioned.cxx|l=127}}.
|example1 = var navaid = findNavaidByFrequency(11.17);
|example1 = var navaid = findNavaidByFrequencyMHz(11.17);
print("ID: ", navaid.id); # prints info about the navaid
print("ID: ", navaid.id); # prints info about the navaid
print("Name: ", navaid.name);
print("Name: ", navaid.name);
29

edits