# Synopsis

void *otm_CycleTree(long option, OTM_TREE *tree)

# Purpose

Cycle an object tree.

# Description

Successive calls to this function will return the next object pointer in the tree or NULL when complete. If the cycle is interrupted, the next invocation of this function will start where the interruption occurred. Any modifications performed on the tree, will reset the cycle. Since the end of the tree and an error both return NULL, mpm_LastError should be called to check for an error condition.

# Input

## option

### OTM_LTOR

cycle from left to right (default)

### OTM_RTOL

cycle from right to left

## tree

Tree pointer

# Return

Object pointer in tree or NULL if error