Dictionary type

Syntax

	structType($key1, $key2, ..., $keyN)

Description

A dictionary type creates dictionaries with predefined keys. A dictionary type can be used to create multiple dictionaries with the same keys but different values (see Dictionary creation).

The following expressions are equivalent:

structType("one", "two", "three")
 .newStruct(1, 2, 3)
{
  "one": 1,
  "two": 2,
  "three": 3
}

Parameter

Name Type Description Mandatory Default
key Number/string/boolean/business object/set A key of the dictionary. yes

Return value

type: Business object

A dictionary type that can be further used for Dictionary creation.

Examples

Multilingual dictionary

	{
  eng = structType("Hello", "Goodbye");
  fr = $eng.newStruct("Bonjour", "Au revoir"); 
  ger = $eng.newStruct("Hallo", "Tschüss");
  $ger["Hello"];
}

Output: Hallo

Generates dictionaries for the different translations.