Welcome to DDB, the ultimate array and dictionary function for AutoHotkey.
DDB is based on COM dictionary object and it is very easy to use.
DDB can be used in three ways.
- Directly using DDB function
- Trough ArrayFunctions
- Trough DictionaryFunctions
To use Array- and DictionaryFunctions functions you will need to define an empty function with predefined parameters.
After DDB() has been called, those empty functions will become functional arrays and dictionaries.
| Function | Usage |
| DDB | You can call DDB(dictionary,action,key,item) function directly to save, get, find, delete... values, see DDB for more information. |
| ArrayFunctions | This is a special feature of DDB, it provides very short and simple syntax. |
| DictionaryFunctions | This is another special feature of DDB, it also provides similar short and simple syntax. |
| Multithreading | DDB also supports multithreading |
Only AutoHotkey 1.0.48.3 is supported at the moment.
To use ArrayFunctions and DictionaryFunctions you need to call DDB() once to initialize and once before exiting the process to terminate.
When using DDB in multithread environment, new functions need to have a different name than the ones in main process and other threads!
Note, when you terminate DDB in your thread, it will be terminated for the whole process!
You can access Array and Dictionary functions using DDB as well, therefor dic parameter must be the name of your function.
DDB, ArrayFunctions, DictionaryFunctions, Thread, Credits
#NoEnv
SetBatchLines,-1
a(var=","){ ;declare array
}
b(var="",value="",cmode="1"){ ;declare dictionary
}
DDB() ;Initialize COM and DDB
Loop 10
a("+" A_Index) ;add values to the end of array
Loop 10
b(A_Index-1,A_Index) ;add some new keys
;Retrieve all items / values separated by . and count keys/items.
MsgBox % a("$`n") "." a("?") "`n`n" b("",5,"`n") "." b("","?")
DDB() ;terminate usage of DDB and COM
ExitApp
#include %A_ScriptDir%\DDB.ahk