fsVarsCustomSimVarSet

The fsVarsCustomSimVarSet function can be used to set the value of a specific CustomSImVar.

 

Syntax
FsVarError fsVarsCustomSimVarSet(
    FsCustomSimVarId varId,
    FsUnitId unitId,
    double value
);

 

Parameters
Parameters Description
varId

The id of a custom simvar.

unitId The id of an unit (found using fsVarsGetUnitId).
value The new value of the simvar.

Return Values

The function returns a FsVarError, 0 means there is no error.

 

Example
FsUnitId unitId = fsVarsGetUnitId("DEGREES");
FsCustomSimVarId varId = fsVarsRegisterCustomSimVar("TOTO", nullptr, FsSimCustomSimVarScopeSim);
double newValue = 123;
if (fsVarsCustomSimVarSet(varId , unitId, newValue) == FS_VAR_ERROR_NONE)
{
    // valid
}
else
{
    // error
}