Next Previous Contents

14. The DICTIONARY object

#Specification: DICTIONARY / principles ([dictionary.cc,6])

A dictionnary is an array of value. Each entry in the array is keyed by a name instead of a numerical index. It is often called an associative array. Two functions exist to set and retrieve values (setting will add a new entry if a corresponding entry does not exist You can enter various information in the array in a type safe maner. In fact the set and get function are organised by type. For example you have setstr() which set a string value. You have getstr() to retrieve it. You have setint() and getint() to manipulate integer data. The "type safe" come from the fact that you can't retrieve a value using a different type function than the one used to encode it. So you can't do setstr("name","jack") and then getint("name"). In fact, you can do

            setstr ("name","jack");
            setint ("name",22);
And then the corresponding function will produce appropriate results
            getstr("name") will produce "jack"
            getint("name") will produce 22

14.1 DICTIONARY Alphabetical function listing

Classe DICTIONARY, vue publique


Next Previous Contents