On this page
fsVarsNamedVarSet
NOTE
Deprecated. Use
fsVarsLVarSet instead.The fsVarsNamedVarSet function can be used to set the value of a specific Named Var.
Syntax
void fsVarsNamedVarSet(
FsNamedVarId var,
FsUnitId unit,
double value
);
Parameters
| Parameters | Description |
|---|---|
var | The ID of a named Var . |
unit | 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
}
Next
fsVarsOVarGet