Dataref.get() Method

The Dataref.get() returns the value for a dataref. The return value depends on the dataref type.

Syntax

Dataref.get()

Parameters

This function has no parameters.

Return value

The value returned depends on the dataref type; it will either be a Number, String, or an Array of Numbers.

To determine the returned type of a dataref, read the type property.

Example

> dataref = simulator.findDataref("laminar/c172/fuel/fuel_tank_selector")
Dataref{ name: "laminar/c172/fuel/fuel_tank_selector" }
> dataref.get()
2
> dataref = simulator.findDataref("sim/aircraft/view/acf_tailnum")
Dataref{ name: "sim/aircraft/view/acf_tailnum" }
> dataref.get()
"N172SP"

References