10 Declaring constants

TTCN-3 constants are run-time constants. After value assignment, they do not change their value during test execution. They can be used on the right hand side of assignments, in expressions, in actual parameters, and in template definitions. Constants used within type definitions have to have values known at compile-time.


Semantic Description

A constant assigns a name to a fixed value. A value is assigned only once to a constant, at the place of its declaration. The constant does not change its value during test execution. The constant is defined only once, but can be referenced multiple times in a TTCN-3 module.

Optional fields of record and set constants or constant fields can be initialized explicitly or implicitly. For implicit initialization of the optional fields of a constant or a constant field, an optional attribute with the value "implicit omit" (see clause Ошибка: источник перекрестной ссылки не найден) shall be associated with it either directly or via the attribute distribution (scoping) mechanism (see clause Ошибка: источник перекрестной ссылки не найден).