Dictionaries

 

A Dictionary is a table with exactly one indexed key column and one or more value columns in which expressions can be stored for a key value.

The advantages of Dictionaries are:

      Very fast existential check of a value of the key column

      Very fast determination of values of the expressions of the value columns via a key

 

This example uses a dictionary to map an image to the Sigma lampshade object.

First, the images of the different lamp shades are stored in a constant group:

  

 

Then we create a dictionary called DicImages:

The dictionary gets the following content:

Then we put a Picture-Control on the form of the class. The control is part of the TCE Picture Controls type library. The type library is selected via the properties of the knowledge base.

The Picture control Picture property receives the following expression:

This expression searches for a match using the value of the color in the key column and returns the value in the Value column for the row of the key value.

You should achieve the following result:

 

Of course, the Dictionary only plays out its capabilities with high amounts of data, which are not feasible in our small example.