On this page
fsVarsCustomSimVarGet
NOTE
Deprecated. Use fsVarsIVarGet, fsVarsOVarGet or fsVarsZVarGet instead.
The fsVarsCustomSimVarGet function can be used to get the value of a specific Custom SimVar.
Syntax
FsVarError fsVarsCustomSimVarGet(
FsCustomSimVarId varId,
FsUnitId unitId,
double* result
);Parameters
| Parameters | Description |
|---|---|
varId | The ID of a custom simvar. |
unitId | The ID of a 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
}