On this page
fsVarsCustomSimdVarGet
NOTE
The fsVarsCustomSimVarGet function can be used to get the value of a specific Custom SimVar.
Syntax
FsVarError fsVarsCustimSimVarGet(
FsCustomSimVardId varId,
FsUnitId unitId,
double* result
);
Parameters
| Parameters | Description |
|---|---|
varId | The ID of a custom simvar. |
unitId | The ID of an unit (found using fsVarsGetUnitId). |
result | The value that will receive the value of the CustomSimVar. |
Return Values
The function returns a FsVarError, 0 means there is no error. In that case, the value of the named variable has been set in result.
Example
FsUnitId unitId = fsVarsGetUnitId("DEGREES");
FsCustomSimVarId varId = fsVarsRegisterCustomSimVar("TOTO", nullptr, FsSimCustomSimVarScopeSim);
double result = 0;
if (fsVarsCustomSimVarGet(varId , unitId, &result) == FS_VAR_ERROR_NONE)
{
// valid
}
else
{
// error
}