# Conditional Statements

This command topic provides generic documentation on constructing conditional statements used in OPERABLE, RETENTION, and AMEND statement groups. See those section links for usage in those command contexts and examples.

Actions

def MyConditionalAction

Operable

{Conditional statements…}

Cut

Retention

{Conditional statements…}

Amend

{Conditional statements…}

Each command section above uses some variant of conditional command statements to limit calculations or activities to certain tree species or species groups with certain tree properties listed in the table below.

Constraint Variable | Metric | USA | Description
IN {species or species group variable}
Species or SpeciesGroup Code | - | - | USDA Plant Codes or OSM Variant defined two character species codes can be used. Only one code can be stated. Define your own species group variable if you want to select multiple species.
WITH {tree attribute conditions}
DBH | cm | inches | DBH at the beginning of the current cycle.
BAL | m2/ha | ft2/ac | Basal area of thicker trees after cut (if any).
HT | m | ft | Total height of live tree stem at the beginning of the current cycle.
Risk | - | - | User-defined tree risk of mortality numerical classification system.
Grade | - | - | User or Variant defined tree numerical classification system for form or quality.

Usage varies depending on statement group (Operable, Cut.Retention, or Amend), but the basic conditional command syntax is:

{Statement Group Dependent Calculation} IN {species variable} WITH {tree conditions}

The IN and WITH statements are always optional and can be stated individually or together. If used together, the IN statement must proceed the WITH statement.

## IN

Limits calculations to certain trees species or species groups (see table above for details).

## WITH

Limits calculations to certain tree properties. Tree properties that can be incorporated into WITH statements are restricted to those listed in the above.

There are a few ways WITH conditions can be formulated:

· WITH DBH >= 10 [DBH >= 10cm (or inches)]

· WITH DBH <= 9.9 [DBH <= 9.9cm (or inches)]

· WITH DBH 2.1 10 [DBH between 2.1cm and 10cm (or inches)]

One or more WITH conditions can be stated after the WITH command.

· WITH DBH >= 10 HT <= 30 [DBH >= 10cm (or inches) AND HT <= 30]

The WITH command is only stated once and each additional condition is additive to the last. There is no way to state OR in a WITH condition. All conditions must all be satisfied for the tree to be selected.

See statement group documentation for actual examples.