fsVarsNamedVarSet
The fsVarsNamedVarSet function can be used to set the value of a specific Named Var.
Syntax
FsVarError fsVarsNamedVarSet(
FsNamedVarId namedId,
FsUnitId unitId,
double value
);
Parameters
Parameters | Description |
---|---|
namedId |
The id of a namedVar . |
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");
FsNamedVarId namedVarId = fsVarsRegisterNamedVar("TOTO");
double newValue = 123;
if (fsVarsNamedVarSet(namedVarId , unitId, newValue) == FS_VAR_ERROR_NONE)
{
// valid
}
else
{
// error
}