Start page / Template development / Template syntax / Expressions

Expressions

In general an expression is understood to be a construct which can be evaluated within a context and which delivers a value. A prescribed semantic must be adhered to.

A differentiation is made between:

  • Constants: Direct value input via constants or variables, for example by specifying a character string, e.g. "text" or a numerical value, e.g. 42.
  • String operations: Methods can be invoked on string objects, for example to join character strings or to extract substrings.
  • Arithmetic Expressions: Within the template syntax, the basic arithmetical operations can be applied to numerical data types in expressions, for example ((3 * 5) + 1) / 2
  • Comparative expressions: Comparative expressions are a sub-area of the logical expressions and return a truth value ('true' or 'false'), i.e. for example a==b or a!=b or a>b
  • Logical expressions: Logic operations link several logical expressions to form a more complex logical expression, for example !a or a && b or a||b
  • Method invocations: Methods are directly invoked on a context object. These include, for example, access to attributes of a complex data type (picture.width) or even certain string operations (element.toString()).

© 2005 - 2024 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2024.13 | Data privacy