CDS239
Hash Map |
Last Revised: 12/28/16 |
This routine simulates a simple hash map in memory. A hash map provides a way to store and retrieve data for a given key.
Calling Format:
CALL "CDS239", GLB$, METHOD$, KEY$, { VAL$, MAP$ }
CDS239 Arguments | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Argument | Passed To/From | Description | |||||||||||||||
GLB$ | To | The name of the global variable where the hash map will be stored. CDS239 will assign and manage the contents of this variable. Note this is the name of the global variable not the value. See example. | |||||||||||||||
METHOD$ | To |
Note: The method value can be upper or lower case, and only the first character is used.
Note that the hash map is not sorted and only provides retrieval of a value given a key. It does not currently provide a way to sort the map by key or value. |
|||||||||||||||
KEY$
|
To | The key associated with the value. Leading and trailing blanks are removed. All keys do not have to be the same size. The key cannot include characters $00$, $01$, nor $02$ . |
|||||||||||||||
VAL$ | To/From | The value associated with the key. The value cannot include characters $00$, $01$ , nor $02$ . Not required for the DELETE action. |
|||||||||||||||
MAP$
|
From | Optional string variable that will return the hash map itself. This may be useful when it is necessary to iterate over the list of keys in the map. |
Example |
|
|