# fsVarsGetUnitId The **fsVarsGetUnitId** function can be used to get the `FsUnitId` of a specific unit using its name.   ##### Syntax ``` wasm FsUnitId fsVarsGetUnitId( const char* unitName ); ```   ##### Parameters {{< table-wrapper >}} | Parameters | Description | |------------|-----------------------| | `unitName` | The name of the unit. | {{< /table-wrapper >}}   ##### Return Values The function returns ID associated with the given unit name. If an error occurred, the function will return -1.   ##### Example ``` wasm FsUnitId unitId = fsVarsGetUnitId("DEGREES"); // valid FsUnitId wrongUnitId = fsVarsGetUnitId("toto"); // returns -1 ```