PureBasic - Map

Overview

Maps (also known as hashtable or dictionary) are structures for storing data which are dynamically allocated depending of your need. It is a collection of elements (the data you want to store) and each element is fully independent of the others. You can add as many elements as you want (or as many as will fit into the memory of your computer), and accessing it back using a key. This kind of data management is very useful when you need fast access to a random element. The inserting order of the elements are not kept when using a map (unlike a List) and therefore they can't be sorted.

Before you can work with Maps, you must declare them first. This could be done with the keyword NewMap. structures are also often used to store multiple data in a single element.

To specifically search the contents of a Map, using of loops is recommended: For : Next, ForEach : Next, Repeat : Until or While : Wend.

Other possibilities for storing data are the use of Arrays and Lists".

Command Index

AddMapElement
ClearMap
CopyMap
DeleteMapElement
FindMapElement
FreeMap
MapKey
MapSize
NextMapElement
PopMapPosition
PushMapPosition
ResetMap

Supported OS

All

Reference Manual - Index