Use variables

Tekla Tedds
2020
Tekla Tedds Tekla Tedds for Word

Use variables

Using variables allows you to use the results of previous calculations in later calculations. For further information on variables and variable levels, see the following paragraphs.

Note:

The following only applies to Tedds for Word.

Variable definitions

All variable definitions take a similar form. The minimal variable definition must include:
  • A variable name

  • An equal sign

  • An expression or a constant value

In addition, most variable definitions include:

  • An explanation
  • A delimiter
  • A unit

The components of a variable definition are very similar to the component of calculations. For more information on each component, see The components of calculations.

Variable levels

Tedds for Word recognizes three different levels of variables:

  1. Calc section variables

  2. Document variables

  3. System variables

This is also the order in which Tedds for Word searches values for each variable that you place in your document. If Tedds for Word cannot find the value in one of the variable levels, a variable definition error occurs.

Note:

You must define each variable before you recall it later in your calculation.

Calc section variables

You can use calc sections to separate the variables in your document from one another. Each calc section stores its own variables independently. This way, you can repeat similar calculations which use the same named variables without the calculations affecting each others' results.

Any variable that you define between the start of one calc section and the start of the next calc section is considered a calc section variable.

Note:
  • If you define variables within one calc section and want to use the variables elsewhere in your document, you can select the variables in a calc section and promote them to document variables.

  • If you define a calc section variable with the same name as a document or system variable, Tedds for Word uses the value that you defined in the current calc section.

  • If you define a variable twice in the same calc section, Tedds for Word uses the initial value up to the point at which the value is redefined. After this point, Tedds for Word uses the new value.

Document variables

Any variable that you define in the document but outside of a calc section is considered a document variable. Usually, you would define document variables before the first calc section of the document.

After you have defined document variables, they are available throughout the document and across all calc sections.

Tip:

To avoid the variables of one set of calculations affecting a different set of calculations, we recommend using calc sections in all calculation documents.

System variables

System variables are provided with Tedds for Word, and you can use them anywhere in your calculations. As system variables are pre-defined, you do not need to define system variables before you use them in your calculations.

To use a system variable, you can simply type the name of the variable in your document.

Tip:

If you want to use a system variable name with a different value, you can redefine the variable, and the modified value will be used in document variables or calc section variables.

Was this helpful?
Föregående
Nästa