Skip to main content

xSuite Interface Windows Prism 5.x – Online Help

Block

Usually, only a single macro expression can be configured for configuration properties. Only some configuration properties allow multiple macros to be defined for execution in sequence. In most use cases, the execution of a single macro expression is completely sufficient. However, in order to be able to execute multiple expressions in individual cases, the syntactic element of a block can be used.

A block can contain several expressions separated by semicolons, encased in curly brackets: {expression1; ...; expressionN}. These expressions will be processed in the order specified.

For example, if the complexity of an initial value for a field of the field catalog requires it to be calculated in two substeps rather than in one continuous macro expression, a block can be used as follows:

{@TempVar = "Hello"; @TempVar + " World"}

In the first expression, an intermediate result is assigned to a temporary variable. In the second expression, this intermediate value is then used to generate the final result value that is to be transferred to the target field. The second expression does not contain an explicit assignment. An assignment is not necessary for field initialization macros, since the target field for the result value is known in this context.

With regard to the internal workings of the program, note that no intermediate results of the individual expressions are implicitly assigned to the target field. Instead, the target field only receives the final calculated result value. For this reason, a temporary variable is used here. Otherwise, a simplified {"Hello"; @TargetField + " World"} could also have been used.

As an alternative to using temporary variables, it is also possible to explicitly assign the intermediate value directly to the target field (i.e., {@targetfield = "Hello"; @targetfield + " World"}).