DistUnits Property
Sets/gets the units in which distance data is to be returned.
Syntax
Visual Basic
object.DistUnits [ = value ]
Visual C++
object.GetDistUnits()
object.SetDistUnits(value)
| Part
| Description |
| object |
An object expression that evaluates to a GPS ToolKit object. |
| value |
A short integer indicating the units in which distance data is to be returned.
|
Example
Visual Basic
'Set distance units
myGPSToolKit.DistUnits = 1 ' feet
'Get distance units
Dim distUnits As Integer
distUnits = myGPSToolKit.DistUnits
Visual C++
// Set distance units
_variant_t vtDistUnits((short)1); // feet
m_myGPSToolKit.SetDistUnits(vtDistUnits);
// Get distance units
vtDistUnits = m_myGPSToolKit.GetDistUnits();
short distUnits = (short)vtDistUnits;
Remarks
This property affects the units of the RangeToDest property, as well
as the range data supplied by the NavUpdate event.
Valid DistUnits values are as follows:
| Setting
| Description |
| 0 |
Meters (Default) |
| 1 |
Feet |
| 2 |
Miles |
| 3 |
Nautical Miles |
Default
0 (meters)
Returns
A VARIANT (type VT_I2/short) containing the units in which distance is to be returned.
Errors
Attempting to set DistUnits to an invalid value will cause GPS ToolKit to throw an "Invalid argument" exception.
See Also
AltitudeUnits property, RangeToDest property
|