fsVarsGetLVarName

The fsVarsGetLVarName function can be used to retrieve the name of a registered LVar.

 

Syntax
FsVarError fsVarsGetLVarName(
    FsLVarId lVarId,
    char* buffer,
    int bufferSize
);

 

Parameters
Parameters Description
lVarId

The ID of an LVar (found using fsVarsGetLVarId or fsVarsRegisterLVar).

buffer The buffer that will receive the name of the LVar, if it exists.
bufferSize The size of the given buffer.

 

Return Values

The function returns FsVarError, where 0 means there is no error (in which case, the name of the LVar has been copied in buffer).

 

Example
FsUnitId unitId = fsVarsGetUnitId("DEGREES");
FsLVarId lVarId = fsVarsRegisterLVar("Toto");
char buffer[128];
buffer[0] = '\0';
if (fsVarsGetLVarName(lVarId, buffer, sizeof(buffer)) == FS_VAR_ERROR_NONE)
{
    // valid, buffer contains "Toto"
}
else
{
    // error
}