This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.
This version is copyright and may only be used for local testing purposes. It may not be distributed.
Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.
Description
Creates a new dictionary and returns a pointer. Use this pointer for all subsequent operations on that specific dictionary.
Syntax
pDictionary = Dictionary_Create(NumberOfKeys [, KeyIsUcase])
Returns
Number: pointer to a dictionary object
If Zero = error.
Parameters
Name |
Type |
Optional |
Meaning |
NumberOfKeys |
Numeric |
No |
Max number of keys. |
KeyIsUcase |
Numeric |
Yes |
If %TRUE, all keys will be considered case insensitive otherwise exact comparison will be performed when searching and during storing of key/data pairs |
Remarks
A typical situation is to create a dictionary with NumberOfKeys = NeededKeys * 2
So if you need to store about 1000 unique keys, create a dictionary of at least 2000 keys.
More than NumberOfKeys keys can be stored into a dictionary but this will slow down all operations.
Restrictions
See also
This functionality has been made obsolete by newer, better optimized hash table available directly in core instead.
Examples
USES "dictionary"
Dim pDict As Long '---Pointer to dictionary
Dim counter As Long
pDict = Dictionary_Create(1000000, %TRUE)
For counter = 1 To 100000
Dictionary_Add(pDict, counter, String$(100, Counter))
Next
MSGBOX 0, "Add OK"
MSGBOX 0, "Data key = 1000 is: " & LEFT$(Dictionary_Find(pDict, 1000),10) & " ..."
Dictionary_Free(pDict)