I want to write something similar to the autofill function in windows (i.e when I type "app" it automatically shows "apple")
I also need to define a dictionary of some sort, using array maybe, for then above function. how can I do that?
I want to write something similar to the autofill function in windows (i.e when I type "app" it automatically shows "apple")
I also need to define a dictionary of some sort, using array maybe, for then above function. how can I do that?
Ive never tried doing something like that, but what I would do is get a dictoinary file (or create one as the user uses the program like Explorer does, depending on what your using the autofill for), create a large array that acts as an index to your file of words contain all or part of every nth word (you dont want to have to search through the entire file every time the user presses a key!), then as the user types more and more, you can narrow down the choices from your index, then display the choices
[code]
your array might look something like this:
SOME_STRUCT
dict_index[0] = "abate", 0
[1] = "amoeba", 55
[2] = "bark", 98
[3] = "drain", 143
.
.
.
then as the user types "app", by searching through your index, you can determine that the 'correct' word must be somewhere between position 55 and position 98, then just display the words that are inbetween those positions, or read in those words and try to narrow down the correct word as the user types in more and more letters.
Oops, forgot to to [/code], now the indentation is ruined. Oh well