How to make a simple dictionary ?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
SpeedMaster
Posts: 494
Joined: 12 Nov 2016, 16:09

How to make a simple dictionary ?

25 Feb 2021, 10:50

I'm looking for a way to make a simple dictionary but I don't know how to do it. :think:
If you already have an example, please let me know. ;)

Code: Select all

; How to make simple dictionary ?
Gui, add, button,xm, Edit entry
Gui, add, button,x+10, Delete entry
Gui, add, button,x+10, Save entry
Gui, add, text,xm, Search
gui, add, edit, xm w500
gui, add, edit, w500 h500
gui, show,, simple dictionary

~esc::
guiclose:
exitapp
return
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: How to make a simple dictionary ?

25 Feb 2021, 10:54

You could use a listview with two columns: word and definition. The listview accommodates auto-complete typing by default. You can provide a simple GUI for editing an entry. The data can be saved to, and loaded from, a plain text file. Sorting a listview is also straightforward.
User avatar
SpeedMaster
Posts: 494
Joined: 12 Nov 2016, 16:09

Re: How to make a simple dictionary ?

25 Feb 2021, 11:41

Thank you for your answer but making a table is exactly what I'm trying to avoid. I'm looking for a different architecture that can also interact with a text file or an ini file.
On second thought it might be too complicated to program. :roll: :)
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: How to make a simple dictionary ?

25 Feb 2021, 11:49

If you just want to show a single definition, then you can read the dictionary into an array, search it easily, display one item, modify it, and save it when done. The main issue might be how you want to handle the type-ahead.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: balawi28, JKJadan and 177 guests