dictionary

Creates a dictionary in Templex.

Syntax

dict = dictionary()

Input

N/A

Example

Example 1
Template:
{dict=dictionary();
dict[“one”]=1;
dict[“two”]=2;
dict[“three”]=3;
dict[“one”]; cr(); dict[“two”]; cr(); dict[“three”]}
Output:
  • 1
  • 2
  • 3
Example 2
Template:
{dict=dictionary();
dict[“one”]=”New”;
dict[“two”]=”Dictionary”;
dict[“one”]; cr(); dict[“two”];}
Output:
  • New
  • Dictionary
Example 3
Template:
{dict=dictionary();
dict[1]=”alpha”;
dict[2]=”beta”;}
The second letter in the Greek alphabet is {dict[2]}.
Output:
The second letter in the Greek alphabet is beta.

Comments

A Templex dictionary is a data type which behaves like an array.