The mergedictionaries( function merges the contents of two or more dictionaries (see Data Dictionaries).
This function has two parameters:
dictionary1 – is the name of the field or variable that contains the original dictionary (must contain binary data).
dictionary2 – is the name of the field or variable that contains the second dictionary (must contain binary data). You can repeat this parameter for three, four or more dictionaries.
The mergedictionaries( function takes two dictionaries and merges them into a new one. For example, suppose you created three dictionaries with information about a person named Mary Wilson.
fileglobal mailInfo,phoneInfo,emailInfo,contactInfo mailInfo=initializedictionary("First","Mary","Last","Wilson", "Address","3987 Olive","City","Tustin","State","CA","Zip","92841") phoneInfo=initializedictionary("First","Mary","Last","Wilson","Phone","562-309-5923") emailInfo=initializedictionary("First","Mary","Last","Wilson","Email","email@example.com")
Later, you could use the mergedictionaries( function to create a combined dictionary that contains all of Ms. Wilson’s contact information:
If the the merged dictionaries contain one or more keys that are the same, the value in the dictionary farthest to the right will overide any dictionaries earlier in the list. In the previous example, all three of the dictionaries contained keys for First and Last, but they all contained the same values so there was no conflict. But what if there was a conflict, for example, suppose the e-mail dictionary contained a different last name (perhaps Mary got married).
If the three dictionaries are merged like this, the contactInfo variable will contain the last name Jackson.
However, if the order of the parameters is reversed, the final last name will be Wilson.
|10.0||Updated||Carried over from Panorama 6.0, but now available as a function. Also, this operation now allows more than two dictionaries to be merged.|