Skip to content
Márk Török edited this page Jul 15, 2020 · 3 revisions

Map

create

It creates a new map.
Precondition : it requires the name of the map
Example : map create fruits
Note : The created map will be in the global scope. Under the hood it is an associative array.

add

It add an element to map.
Precondition : it requires the name of the map, the key and the element.
Example : map add fruits apple 2

erase

Removes all elements from map.
Precondition : it requires the name of the map.
Example : map erase fruits

size

Returns the number of elements in the map.
Precondition : it requires the name of the map.
Example : map size fruits

remove

Removes the mapping for a key from the map.
Precondition : it requires the name of the map and the key.
Example : map remove fruits apple

get

Returns the value to which the specified key is mapped.
Precondition : it requires the name of the map and the key.
Example : map get fruits apple

set

Sets a value to the specified key in the map.
Precondition : it requires the name of the map the key and the value.
Example : map set fruits apple 3

keys

Return the keys contained in the map.
Precondition : it requires the name of the map.
Example : map keys fruits

values

Returns the values contained in the map.
Precondition : it requires the name of the map.
Example : map values fruits

contains

Returns true if the map contains a mapping for the specified key otherwise returns false.
Precondition : it requires the name of the map ant the key.
Example : map contains fruits apple

empty

Returns whether the map is empty.
Precondition : it requires the name of the map.
Example : map empty fruits

destroy

It destroys the map.
Precondition : it requires the name of the map.
Example : map destroy fruits

Clone this wiki locally