# Variables, formulas, intermediate values

### Variable system

The variable system is used equally for point symbols, HRB, and combination elements. A detailed description can be found in the documentation **Variablen\_Ud\*.doc**.

### Intermediate values

For combination elements, the system of intermediate values is available. Intermediate values are variables whose value is calculated by a formula. The main purpose is to break formulas into multiple steps so that they can be calculated more clearly. In addition, the result can be used in any number of other places; there it is then not necessary for the full formula to appear at each location.

Further description in the chapter: Combination elements - Intermediate values.

### Conditions

Conditions can be used to decide for all elements in a combination element whether they are to be used or not. This allows a combination element to cover many situations; otherwise, a separate combination element would have to be created for each situation.

Freely definable conditions are also used for conditional calculations in intermediate values. See the chapter on intermediate values.

\[Condition 'insert into for combination element:']{.underline}

In addition to freely definable conditions, there is also the special condition 'insert into for combination element'. The options here are 'Wall (front side only)', 'Wall (rear side only', 'Framework (front side only)' and 'Framework (rear side only)'. These options arise from practical requirements and cannot be replaced by free conditions. The condition refers to where the entire combination element is inserted, not where the individual component is used.

\[Comparisons that can be used in conditions:]{.underline}

\= equal to. The value before and after the sign must match exactly.\
Example: VAB = 4 is satisfied if VAB is exactly equal to 4.

!= not equal to. The value before the sign must be different, that is, greater than or less than the value after the sign.\
Example: VAB!=4 is satisfied if VAB is greater than or less than 4.

\> greater than. The value before the sign must be greater than the value after the sign.\
Example: VAB>4 is satisfied if VAB is greater than 4.

\>= greater than or equal to. The value before the sign must be greater than or equal to the value after the sign.\
Example: VAB>=4 is satisfied if VAB is greater than or equal to 4.

< less than. The value before the sign must be less than the value after the sign.\
Example: VAB<4 is satisfied if VAB is less than 4.

<= less than or equal to. The value before the sign must be less than or equal to the value after the sign.\
Example: VAB<=4 is satisfied if VAB is less than or equal to 4.

& and. Multiple conditions can also be linked by &. So if VAB must be greater than 4 and less than 8, the full expression is:\
(VAB>4)&(VAB<8)

#### Tolerance in numerical comparisons:

When comparing with the value of a calculation, it must be noted that numbers in the calculator are held with very many decimal places. Instead of 1.0, the calculator may therefore contain 0.99999999999 or 1.00000000000001. If one compares exactly to 1.0 (VA=1.0), the comparison may fail even though the condition is technically satisfied.

* In such cases, comparison can be made with a tolerance. To do this, the difference from the desired value is checked. If VA=1.0 is to hold with a maximum tolerance of 0.01, then the difference must lie between -0.01 and +0.01. The condition can then be:\
  ((0.01>(VA - 1.0))&(-0.01<(VA - 1.0)))\
  To eliminate the sign, the abs function can also be applied to the difference.\
  (0.01>(abs(VA - 1.0)))
* In other cases, it is sufficient to compare with a safe number. In distributions, a count is often calculated. If, for example, the condition is that the count (VANZ) is greater than 3, then we do not compare with greater than 3, but with (VANZ>2.5). Then it does not matter whether the actual result for VANZ is 2.999999 or 3.0000001.

### Control file for the variables

Each time a combination element is inserted, the file **%DHPTMP%\KOLVariablen.log** is written. It contains the values of all variables, both user and all system variables, as they were set in the last insertion. The values of the intermediate values are also listed here.

It should be noted that coordinate specifications refer to the insertion coordinate system.

This file is an important aid in the creation of combination elements, because it often allows one to see very quickly at which point the unexpected results occurred.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dietrichs.com/dietrichs-intelligent-documentation/docs-de-en/combined-elements/create-edit-combined-elements/variables-formulas-intermediate-values.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
