Clear Map

Tags:  

Table of Contents  [ Hide]

Maps - Clear Map


The clear map Deluge task removes all key-value mappings from the map and makes it empty.

Syntax

<map>.clear(); 

where,

<map> refers to the name of the map to be cleared.

Example

In the following example, all key-value mappings in map1 will be removed.

actions
{
on add
{
on load
{
map1 = map();
                map1.put("John", "India");
                map1.put("David", "USA");
                alert(map1.size() + "entries available"); //before clear task the map  variable's size is 2
                map1.clear();
                alert(map1.size() + "entries available"); //after clear task the map variable's size is 0

}



0 Comments  Show recent to old
Post a comment


 RSS of this page