fsVarsGetIVarId

The fsVarsGetIVarId function can be used to get an existing IVar.

 

Syntax
FsLVarId fsVarsGetIVarId(
    const char* name,
    const char* componentPath,
    FsObjectId target
);

 

Parameters
Parameters Description
name

The name of the variable.

componentPath

The path of the component. The path format is

  • path:to:component

or

  • path:to:component@alias

Note that the alias is not mandatory but is recommended for performance issue and to avoid conflicts.

target

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

Possible targets are:

  1. FS_OBJECT_ID_USER_AIRCRAFT
  2. FS_OBJECT_ID_USER_AVATAR
  3. FS_OBJECT_ID_USER_CURRENT

Default: FS_OBJECT_ID_USER_AIRCRAFT.

 

Return Values

The function returns the ID associated with the given name. If the given name has not been registered, the function will return FS_VAR_INVALID_ID. If an error occurred, the function will return FS_VAR_INVALID_ID.

 

Remarks

IVar are local to an instrument, regardless of the component from which the variable is retrieved, and it will be the same ID on all the components of the instrument, from the root component to its last child.

 

Example
FsIVarId iVarId = fsVarsGetIVarId("TOTO", "LIGHTING");