SpeedUnits Property
Sets/gets the units in which speed data is to be returned.
Syntax
Visual Basic
object.SpeedUnits [ = value ]
Visual C++
object.GetSpeedUnits()
object.SetSpeedUnits(value)
| Part
| Description |
| object |
An object expression that evaluates to a GPS ToolKit object. |
| value |
A short integer indicating the units in which speed data is to be returned.
|
Example
Visual Basic
'Set speed units
myGPSToolKit.SpeedUnits = 0 ' mph
'Get speed units
Dim speedUnits As Integer
speedUnits = myGPSToolKit.SpeedUnits
Visual C++
// Set speed units
_variant_t vtSpeedUnits((short)0); // mph
m_myGPSToolKit.SetSpeedUnits(vtSpeedUnits);
// Get speed units
vtSpeedUnits = m_myGPSToolKit.GetSpeedUnits();
short speedUnits = (short)vtSpeedUnits;
Remarks
This property affects the units of the Speed property, as well
as the speed data supplied by the FixUpdate event.
Valid SpeedUnits values are as follows:
| Setting
| Description |
| 0 |
mph |
| 1 |
kph |
| 2 |
knots (Default) |
Default
2 (knots)
Returns
A VARIANT (type VT_I2/short) containing the units in which speed is to be returned.
Errors
Attempting to set SpeedUnits to an invalid value will cause GPS ToolKit to throw an "Invalid argument" exception.
See Also
Speed property, FixUpdate event
|