MakeDictionary

(VTS Library)

Description: Create and initialize a dictionary with one line of code.
Returns: Dictionary
Usage: Script Only.
Function Groups: Dictionary, Variable
Related to: Dictionary | ArrayToDictionary
Format: System.MakeDictionary(Key1, Value1, ...)
Parameters:  
Key1
The first key of the dictionary
Value1
Value for that key
Comments:

Up to 50 key + value pairs can be provided as parameters.

If the MakeDictionary() call is passed as a function argument, a temporary dictionary is created and will be destroyed when the function ends.

This module is a member of the System Library, and must therefore be prefaced by \System. as shown in the "Format" section.

If your application predates version 11.2, use the backslash notation rather than dot: \System\

Examples:

 SomeFunction(System.MakeDictionary("Key1", 1,
                                     "Key2", 2,
                                     "Key3", 3));
{ is equivalent to:  }
 D = Dictionary();
 D["Key1"] = 1;
 D["Key2"] = 2;
 D["Key3"] = 3;
 SomeFunction(D);
 D = Invalid;  { free up memory }