---
name: "inheritsFrom"
type: command
status: ok
groups: ["Config"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/inheritsFrom
revid: 349770
updated: 2023-11-20T22:10:08Z
---

# inheritsFrom

*Command · Config · Arma 3 v0.50 · introduced in Armed Assault v1.00*

## Description

Returns base entry of config entry.

## Syntax

```sqf
inheritsFrom config
```

**Parameters:**

- `config`: [Config](../topics/Config.md)

**Returns:** [Config](../topics/Config.md)

## Examples

### Example 1

```sqf
_base = inheritsFrom (configFile >> "CfgVehicles" >> "Car"); // returns "LandVehicle" Config entry
```

### Example 2

Print parent tree of given config class:

```sqf
fnc_printParents =
{
    disableSerialization;
    if (!isClass _this) exitWith { hint "Argument is not a config Class" };

    private _parents = [];

    while { !isNull _this } do
    {
        _parents pushBack configName _this;
        _this = inheritsFrom _this;
    };

    reverse _parents;

    private _tv = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscTree", -1];
    _tv ctrlSetPosition [0,0,1,1];
    _tv ctrlSetBackgroundColor [0,0,0,0.5];
    _tv ctrlCommit 0;

    private _path = [];
    {
        _tv tvAdd [_path, _x];
        _path pushBack 0;
    }
    forEach _parents;

    tvExpandAll _tv;
};

// Example:
(configFile >> "CfgVehicles" >> typeOf player) call fnc_printParents;
```

## See also

[configFile](../commands/configFile.md) · [a / b](../commands/a_~2F_b.md) · [configName](../commands/configName.md) · [count](../commands/count.md) · [getArray](../commands/getArray.md) · [getText](../commands/getText.md) · [getNumber](../commands/getNumber.md) · [isArray](../commands/isArray.md) · [isClass](../commands/isClass.md) · [isNumber](../commands/isNumber.md) · [isText](../commands/isText.md) · [select](../commands/select.md) · [configHierarchy](../commands/configHierarchy.md) · [isKindOf](../commands/isKindOf.md)

## Community notes

**ffur2007slx2_5** — 2014-04-02

(A3 1.14) Use [BIS_fnc_returnParents](../functions/BIS_fnc_returnParents.md) if a parents' collection of the given entry is needed.

```sqf
[configFile >> "CfgVehicles" >> "Land_Atm_02_F", true] call BIS_fnc_returnParents;
// return: ["Land_Atm_02_F", "House_Small_F", "House_F", "House", "HouseBase", "NonStrategic", "Building", "Static", "All"]
```

Not all entries have parent, and please differ parents from path.

```sqf
inheritsFrom (configFile >> "CfgUIColors" >> "IGUI" >> "Presets" >> "PresetA1" >> "Variables");
// return: Nothing
```

<sub>Source: [BI Community Wiki — inheritsFrom](https://community.bistudio.com/wiki/inheritsFrom) (revision 349770).</sub>
