Creator Help

Create Map

Table of ContentsDown

Create Map

The Create Map deluge syntax creates a new empty map expression. If the target map variable is already defined as map variable, then all its content will be erased. The map expression related tasks (put, putAll, remove, clear) and opertions can be done only if the map variable is defined.

map() - map constructor to create and initalize map variable.
{} - Holds map values. Handy syntax for creating map with some initial values.
Example:  hdrs = { "Email" : "support@mydomain.com", "Passwd" : "mypassword", "accountType" : "HOSTED_OR_GOOGLE", "service" : "cl" };

Example

In the following sample code, a map named map1 is defined in the on add -> on load block and initialized with the map() constructor.

actions
{
on add
{
on load
{

map1 = map(); // map constructor to initalize the map variable named map1.
map1.put("creator","http://creator.zoho.com");
map1.put("writer","http://writer.zoho.com");
map1.put("sheet","http://sheet.zoho.com");                                       
              // Following is map constructor to declare a variable with default values
               hdrs = { "Email" : "support@mydomain.com", "Passwd" : "mypassword", "accountType" : "HOSTED_OR_GOOGLE", "service" : "cl" };
}
}

Top