dictionarydifference
DICTIONARYONE
,
DICTIONARYTWO
,
DIFFERENCES

The dictionarydifference statement builds an array that lists keys of dictionary values that are different between two dictionaries (see Data Dictionaries).


Parameters

This statement has three parameters:

dictionaryone – first dictionary.

dictionarytwo – second dictionary.

differences – field or variable that will contain a list of keys that have different values in the first and second dictionary (carriage return separated).


Description

This statement takes two dictionaries and lists the differences (if any). It does this by getting the list of keys in each dictionary, and then comparing the value of each key.

local primaryContact,secondaryContact,differences
primaryContact = initializedictionary(
    "First","John",
    "Last","Wilson",
    "Address","3987 Olive",
    "City","Tustin",
    "State","CA",
    "Zip","92841")
secondaryContact = initializedictionary(
    "First","John",
    "Last","Wilson",
    "Address","7823 Aspen",
    "City","Lake Forest",
    "State","CA",
    "Zip","92841",
    "Phone","555-1234")    
dictionarydifference primaryContact,secondaryContact,differences
message differences

With the data shown above, this example will display the three keys that are different between the two dictionaries.

Address
City
Phone

Note: The dictionarydifference statement treats a missing key/value pair as if it had a value of "". So in the example below, no differences will be found:

local primaryContact,secondaryContact,differences
primaryContact = initializedictionary(
    "First","",
    "Last","",
    "Address","",
    "City","",
    "State","",
    "Zip","")
secondaryContact = ""    
dictionarydifference primaryContact,secondaryContact,differences
message differences

See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but uses new internal dictionary format