I have not followed this thread at all but saw a mention of the use of associative arrays and what appeared as confusion about the defauilt result. That is the only aspect to which I am replying.
See Help > Books > Scripting Guide and search for associative arrays in the Table of Contents:
Default Values
A default value determines the value of a key that does not exist in an associative array. If you
try to access a key that does not exist in an associative array, an error results. If you define a
default value for your associative array, accessing a key that does not exist results in the
following:
• adds the key to the associative array
• assigns the default value to the new key
• returns the new key’s (default) value instead of an error
If you construct an associative array from a list of strings without assigning values to the keys,
then the keys are assigned values of 1. The default value for the associative array is set to 0.
To set the default value:
cary = Associative Array();
cary << Set Default Value( "Cary, NC" );
To determine whether there is a default value set for an associative array, use the <<Get
Default Value message.
cary << Get Default Value;
"Cary, NC"
If there is no default value, Empty() is returned.
Besides the Set Default Value message, a default value can be set in the literal constructor
using =>value without a key.
counts = ["a" => 10,
"b" => 3,
=> 0]; // default value of 0
counts["c"] += 1;
Show( counts );
counts = ["a" => 10, "b" => 3, "c" => 1, => 0];
In the first line, the default value is set to 0. In the second line, the key "c" does not exist in
counts. In the output, the key "c" is created with the default value of 0 and then incremented
by 1.
Note: If a key’s value is the default value, then the key is dropped because any key will return
the default value.