The fsVarsOVarGet function can be used to get the value of a specific OVar.

 

Syntax
FsVarError fsVarsOVarGet(
    FsOVarId oVarId,
    FsUnitId unitId,
    double* result,
    FsObjectId target
);

 

Parameters
ParametersDescription
iVarId

The ID of an OVar (found using fsVarsGetOVarId or fsVarsRegisterOVar).

unitIdThe ID of a unit (found using fsVarsGetUnitId).
resultThe variable that will receive the value of the OVar (if all others parameters are correct).
target

The ID of the object from which the variable is being retrieved.

 

Return Values

The function returns FsVarError, where 0 means there is no error (in which case, the value of the OVar has been set in result).

 

Example
FsUnitId unitId = fsVarsGetUnitId("DEGREES");
FsOVarId oVarId = fsVarsRegisterOVar("Toto", "LIGHTING:EMISSIVE");
double result = 0;
if (fsVarsOVarGet(oVarId, unitId, &result) == FS_VAR_ERROR_NONE)
{
    // valid
}
else
{
    // error
}