In this example, we are going to store a complete database table in a framework field scoped as session (__LabelDictionary). The data will be accessed by referencing the dictionary. This technique saves time, particularly database access. A dictionary is a type of array that uses a key rather than a index value.
The table 'Translation' is retrieved when a user logs in. That is, it is only accessed once per user access. Two fields are retrieved, the EnglishName and Column_Selector. In this example, EnglishName is the primary key.
To create a dictionary, use a QASSIGN and add the attribute, 'key'. When this QFIND is executed, the dictionary will automatically be created. The scoping of the field icon, __LabelDictionary, as session, will save the dictionary for future use by the user. If you want all users to be able to access the dictionary (as a global value), scope the field as application.
The column_selector, based on the user's country, defines the output language. The Translation table contains several columns that, using the EnglishName, translate words into several languages.
Now that we have our dictionary, how do we access it? Simply, by referencing the dictionary icon and key value. In this case, when the key value (EnglishName) is 'Search'. The output will be the word that translates from 'Search' according to the user's language.
You can either re-create this abacus in all frameworks that require a translation or in one framework where the abacus is acquired. In both cases, the field, __LabelDictionary (scoped as session with framework sharing enabled) must exist.