On this page
fsVarsBVarGet
The fsVarsBVarGet function can be used to get the value of a specific BVar.
Syntax
FsVarError fsVarsBVarGet(
FsBVarId bVarId,
FsUnitId unitId,
double* result,
FsObjectId target
);Parameters
| Parameters | Description |
|---|---|
bVarId | The ID of a BVar (found using fsVarsGetBVarId). |
unitId | The ID of a unit (found using fsVarsGetUnitId). |
result | The variable that will receive the value of the BVar if the other parameters are correct. |
target | The ID of the object from which the variable is being retrieved. Default: FS_OBJECT_ID_USER_AIRCRAFT. |
Return Values
The function returns a FsVarError, where 0 means there is no error (in which case, the value of the BVar has been set in result).
Example
FsUnitId unitId = fsVarsGetUnitId("BOOLEAN");
FsBVarId bVarId = fsVarsGetBVarId("AUXILIARY_SUNSHADE_ADJUST_PILOT", false);
double result = 0;
if (fsVarsBVarGet(bVarId, unitId, &result, FS_OBJECT_ID_USER_AIRCRAFT) == FS_VAR_ERROR_NONE)
{
// valid
}
else
{
// error
}