classicdictionaryvalue(
DICTIONARY
,
KEY
)

The classicdictionaryvalue( function returns the value of an item in the dictionary, given its key (see Data Dictionaries). Unlike getdictionaryvalue(, this function does not treat keys as case sensitive.


Parameters

This function has two parameters:

dictionary – is the name of the field or variable that contains the dictionary (must contain binary data).

key – is the name of the key for the value you want to retrieve. The key is not case sensitive, so for example key, Key and KEY all refer to the same item.


Description

The classicdictionaryvalue( function takes a key name and returns the corresponding value from dictionary collection. For example, suppose you created a dictionary and stored it in variable named mailto.

letfileglobal mailto = initializedictionary(
    "Address","3987 Olive",
    "City","Tustin",
    "State","CA",
    "Zip","92841")

Later, you could use the classicdictionaryvalue( function to retreive different values from the dictionary:

classicdictionaryvalue(mailto,"Address") ☞ 3987 Olive
classicdictionaryvalue(mailto,"City") ☞ Tustin
classicdictionaryvalue(mailto,"State") ☞ CA
classicdictionaryvalue(mailto,"Zip") ☞ 92841

Unlike the getdictionaryvalue( function, the classicdictionaryvalue( function ignores the case (upper vs. lower) of the key. So these three formulas all produce the same result:

classicdictionaryvalue(mailto,"city") ☞ Tustin
classicdictionaryvalue(mailto,"City") ☞ Tustin
classicdictionaryvalue(mailto,"CITY") ☞ Tustin

This function is named “classic” because in previous versions of Panorama (6 and earlier), the getdictionaryvalue( function also treated keys as case insensitive. So if you have a Panorama 6 (or earlier) database that relies on case insensitive keys, you can modify your formulas to use the classicdictionaryvalue( function for compatibility.

Note that there are a couple of disadvantages to the classicdictionaryvalue( function. First, it is slightly slower than the getdictionaryvalue( function. The speed penalty will be more severe for larger dictionaries.

Secondly, the classicdictionaryvalue( function will not be able to access all dictionary items if a dictionary contains multiple items with keys that are the same except for upper lower case. For example, suppose the dictionary created in the example ablove was modified to add another item with the key STATE, like this:

setdictionaryvalue mailto,"STATE","California"

Now there is both a State item and a STATE item, each with different values. With the getdictionaryvalue( function you can reliably access both of these values. But only one of these values can be accessed by the classicdictionaryvalue( function, the other cannot be reached. Even worse, it is not predictable which value can be accessed and which is unreachable. So if you use the classicdictionaryvalue( function, make sure that all of the keys are different, and none are the same except for upper/lower case. (Note: Panorama 6 had this same problem, but there was no way around it.)


See Also


History

VersionStatusNotes
10.2NewNew in this version (but was added for compatibility with logic that relied on case insensitive keys in Panorama 6).