Dictionary

(Engine-Level Function)

Description: Creates a database-like storage structure that provides efficient addition, retrieval and removal of information linked to key values.

Keys can be any data type although integers and strings are recommended. Values can be any data type including another dictionary.

Returns: Dictionary
Usage: Script Only.
Function Groups: Dictionary,  Variable
Related to: MetaData | MakeDictionary | ArrayToDictionary | DictionaryCopy | DictionaryRemove | GetNextKey | GetKeyCount | HasMetaData | IsDictionary | ListKeys | RootValue
Format: Dictionary( [case] , [ root] );
Parameters:  
Case
Optional. A Boolean indicating whether the keys in the dictionary are to be case sensitive.
TRUE == Not Case Sensitive (default)
FALSE == Case Sensitive
Root   

Optional text value. Numeric values will be cast to text.
If not provided, the dictionary will have no root value. (default: Invalid)

In practice, root values are only ever assigned to dictionaries to create nested dictionaries. If the script cannot find a specific key in a dictionary it will then search the nested dictionary.

A[0] has a unique relationship with Root Values.
If A[0] is first used as a typical key with an assigned value it will behave like a key with a value forever. The value can be changed by assigning a new value to A[0] and is unaffected by anything else.
If A[0] is first assigned a Root Value it's behavior will change. A[0] becomes a variable with Meta Data. The value can be changed by assigning a new value to A[0] OR A[""] OR by using RootValue().

The order of operations matters.
If you set
A[0] = 7
A[""]= 6
and then
A[0]= 5
then A[0] AND A[""] will both equal 5.

However if you first set
A[""] = 6
and then A[0] = 5
then A[""] = 6 and A[0] = 5

Example:

    X = Dictionary();
    X["A"] = 42;
    X["B"] = 86;
    X["C"] = 99;