NOTE
Deprecated. Use fsVarsIVarSet, fsVarsOVarSetorfsVarsZVarSetinstead.

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

 

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

 

Parameters
ParametersDescription
varIdThe ID of a custom simvar.
unitIdThe ID of an unit (found using fsVarsGetUnitId).
valueThe 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
}