initializedictionary(
KEY
,
VALUE
)

The initializedictionary( function builds a new dictionary and initializes it with zero or more key/value entries (see Data Dictionaries).


Parameters

This function has two parameters:

key – name of an entry (this must be a text value). You can have more than one key parameter, as long as each key is accompanied by an associated value parameter.

value – value of an entry (this may be any type of value).


Description

The initializedictionary( function creates a new collection of values (dictionary) and initializes it with one or more key/value pairs. This example creates a new dictionary collection containing a US mailing address.

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

Dictionary values are not restricted to text – you can use any type of data that Panorama supports, including numbers, dates, and binary data. This example includes both numbers and a date.

initializedictionary("SKU",10445,"Description","Widget","Price",12.95,
    "On Hand",687,"Last Order Date",date("12/17/2012"))

Advanced Note: If you used dictionaries in a previous version of Panorama (6.0 or earlier), the internal format used for dictionary collections has changed. The older version supported only MacOSRoman encoded text (no Unicode text), and did not support non text values. The new format lifts both of these restrictions. The old format is still supported in “read-only” mode – the data in an old format dictionary can still be accessed, but will automatically be converted to the new format if any changes are made.


Error Messages

initializedictionary( function is missing a value parameter. – This function requires an even number of parameters. If an odd number of parameters is supplied, this error will occur.


See Also


History

VersionStatusNotes
10.0NewNew in this version.