<< Click to Display Table of Contents >> Navigation: ThinBASIC Modules > Obsolete > Dictionary > Dictionary_Add |
Description
Add or change a key/data pair into a dictionary.
Syntax
pData = Dictionary_Add(pDictionary, KeyName, DataToStore)
Returns
Number: pointer to the first byte of the data stored into the dictionary.
Parameters
Name |
Type |
Optional |
Meaning |
pDictionary |
Numeric |
No |
Pointer to a dictionary. |
KeyName |
String |
No |
Name of the key |
DataToStore |
String |
No |
Data to store |
Remarks
If KeyName does not exists into dictionary a new element will be created and its data stored.
If KeyName already exists into dictionary current data will be replaced with the new one.
Restrictions
See also
This functionality has been made obsolete by newer, better optimized hash table available directly in core instead.
Examples
Dim pData As DWord At Dictionary_Exists(pDictionary, KeyName)
If GetAt(pData) <> 0 Then
SizeOfData = StrPtrLen(pData)
End If