The fsVarsBVarStringGet function can be used to get the value of a specific BVar containing a string.

 

Syntax
FsVarError fsVarsBVarStringGet(
    FsBVarId bVarId,
    FsUnitId unitId,
    char* buffer,
    int bufferSize,
    FsObjectId target
);

 

Parameters
ParametersDescription
bVarId

The ID of a BVar (found using fsVarsGetBVarId).

unitIdThe ID of a unit (found using fsVarsGetUnitId).
bufferThe buffer that will receive the value of the BVar if others parameters are correct.
bufferSizeThe size of the given buffer.
target

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

 

Return Values

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

 

Example
FsUnitId unitId = fsVarsGetUnitId("String");
FsAVarId bVarId = fsVarsGetBVarId("BVarString", false);
char buffer[128];
buffer[0] = '\0';
if (fsVarsBVarGet(bVarId, unitId, buffer, sizeof(buffer), FS_OBJECT_ID_USER_AIRCRAFT) == FS_VAR_ERROR_NONE)
{
    // valid
}
else
{
    // error
}