Slightly different approach using an associative array:
Names Default To Here( 1 );
MasterList = {"test1", "test2"};
// associative array containing lists
Master_AA = Associative Array();
for (i = 1, i <= nitems(masterlist), i++,
one_key = masterlist[i];
master_aa[one_key] = {};
);
// Load the lists with some data
insertinto(master_aa["test1"], {1, 2, 3});
insertinto(master_aa["test2"], {4, 5, 6});
print(master_aa);
Output:
["test1" => {1, 2, 3}, "test2" => {4, 5, 6}]