Greetings everyone. This is my first public plugin. I made it in order to learn C++ and test some concepts for another plugin I had in mind, but it took on a life of it's own.
What it does is allows the user to make a Dictionary style list (basically a 1 dimensional array) with key/value pairs. The key and the value can be of any data type except for UDT's and arrays. It is a similar concept to the Generic Dictionary class in .NET, hash tables in Perl, or std::map in C++ (in fact that was what I used to make this).
Command List and Usage:
MAKE DICTIONARY index
DICTIONARY SET index, key, value
returnvalue = DICTIONARY GET(index, key)
DELETE DICTIONARY index
DELETE KEY FROM DICTIONARY index, key
CLEAR DICTIONARY index
returnvalue as integer = DICTIONARY SIZE(index)
The plugin is fully documented (and then some) with help files, keyword file, and heavily documented C++ source code. It is released under the GNU LGPL so it may be modified or used in commercial projects. A copy of all relevant licenses is provided. All I ask is that any modifications or additions to the code that might benefit the community be posted back to this thread for all to gain the benefit of.
Here is a sample bit of code to show how it would be used... sorry, it isn't very pretty. It was my test code when making the plugin.
test1 as string
test2 as string
test3 as float
test4 as float
firstval as string
secondval as string
thirdval as float
fourthval as float
`Values for Dictionary 1
test1 = "Hello World"
test2 = "Goodbye World"
`Values for Dictionary 2
test3 = 42.42
test4 = 24.24
`Make the Dictionaries
Make Dictionary 1
Make Dictionary 2
`Set the values by Index, Key, Value
Dictionary Set 1, "test", test1
Dictionary Set 1, "me", test2
Dictionary Set 2, 4, test3
Dictionary Set 2, 8, test4
Dictionary Set 2, 9.67, "test mixed"
`Retrieve the values we just set by Index, Key
firstval = Dictionary Get(1, "me")
secondval = Dictionary Get(1, "test")
thirdval = Dictionary Get(2, 4)
fourthval = Dictionary Get(2, 8)
fifthval$ = Dictionary Get(2, 9.67)
Print "Test1 (Dictionary 1) = " + firstval
Print
Print "Test2 (Dictionary 1) = " + secondval
Print
Print "Test3 (Dictionary 2)= " + str$(thirdval)
Print
Print "Test4 (Dictionary 2)= " + str$(fourthval)
Print
Print "Text Mixed Values (Dictionary 2) = " + fifthval$
Print
Print "Size of Dictonary 2 = " + str$(Dictionary Size(2))
wait key
Hope you enjoy. For anyone that is interested, there is a TODO list in the help files. If you would like, take a look over that and if there is a feature you would like to add, feel free. I am not going to have much time to work on this so it is open for anyone. Source code is located in the Help/DBPDictionaries directory.
Design documents?!? What design documents??? I thought we were just going to wing it!!!