---
name: "Blt_TreeExists"
section: "3"
platform: "linux"
package: "blt-dev"
version: "2.5.3+dfsg-8"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Blt_TreeExists"
---

# Blt\_TreeExists(3)

Indicates if a tree exists.

```

```

## NAME

Blt\_TreeExists - Indicates if a tree exists.

## SYNOPSIS

```
#include <bltTree.h>

int
Blt_TreeExists(interp, name)
```

## ARGUMENTS

- Tcl\_Interp *\*interp* (in)

  Interpreter to determine current namespace context.

- const char *\*name* (in)

  Name of an existing tree data object.  Can be qualified by a namespace.

  ```

  ```

## DESCRIPTION

This procedure determines if a C-based tree data object exists by a given name. The arguments are as follows:

- interp

  Used the determine the current namespace context.

- name

  Name of an existing tree data object.  *Name* can be qualified by a namespace such as **fred::myTree**.  If no namespace qualifier is used, the current namespace is searched, then the global namespace.

## RETURNS

A boolean result is returned.  If the tree exists 1 is returned, 0 otherwise.

## EXAMPLE

The following example checks if a tree "myTree" exists.

```

if (!Blt_TreeExists(interp, "myTree")) {
    fprintf(stderr, "can't find tree \"myTree\\n");
}
```

## KEYWORDS

tree, token Tcl\_TreeCreate, Tcl\_TreeGetToken, Tcl\_TreeReleaseToken
