server program mapSample for form dummy { // initialize a new map object: New var petCat = map.New(); trace "This is our map so far:", petCat; // set a few keys for our map: SetAt trace "This is our map so far:", petCat; petCat.SetAt("age", 3); petCat.SetAt("name", "Fjord"); petCat.SetAt("weight", 2); // re-setting the weight value petCat["weight"] = 25; // adding a new key-value pair petCat["sex"] = "female"; trace "This is our map now:", petCat; // see the values in our map: GetAt trace "This is our map so far:", petCat; trace "The cat's name is ", petCat.GetAt("name"); trace "The cat's name is STILL", petCat["name"]; /* Passing undefined keys throws an error trace petCat.GetAt("c);*/ // see if there's a given key in the map: ContainsKey trace "This is our map so far:", petCat; var c = petCat.ContainsKey("color"); var d = petCat.ContainsKey("weight"); trace "No: ", c, "Yes: ", d; // how many key-value pairs are there? Count trace "This is our map so far:", petCat; var e = petCat.Count(); trace e; // reset the map: Clear trace "This is our map so far:", petCat; trace "The map has", petCat.Count(), "items."; petCat.Clear(); trace "The reset map has this many items: ", petCat.Count(); var dog = {'@#!%':1, foo:2}; trace dog.foo; trace dog.'@#!%'; trace dog["foo"]; trace dog["@#!%"]; var f = "fo"; trace dog[f + "o"]; }