fsVarsNamedVarGet

The fsVarsNamedVarGet function can be used to get the value of a specific Named Var.

 

Syntax
FsVarError fsVarsNamedVarGet(
    FsSNamedId simvarId,
    FsUnitId unitId,
    double* result
);

 

Parameters
Parameters Description
simvarId

The id of a named var.

unitId The id of an unit (found using fsVarsGetUnitId).
result The value that will receive the value of the NamedVar.

Return Values

The function returns a FsVarError, 0 means there is no error. In that case, the value of the named varaible has been set in result.

 

Example
FsUnitId unitId = fsVarsGetUnitId("DEGREES");
FsNamedVarId namedId = fsVarsRegisterNamedVar("TOTO");
double result = 0;
if (fsVarsNamedVarGet(namedId , unitId, &result) == FS_VAR_ERROR_NONE)
{
    // valid
}
else
{
    // error
}