ListBox – TextFile Interactions : Search Items
Today, I’ve added a Search function to our Mini Email Address Book. Thanks to Reteset who helped me in correcting my codes.
As you can see, I did a bit of cleaning up on the interface and add more buttons, including the Search Utility in a DialogEx. You will also noticed that I used Labels to show Number of Items in ListBoxes. It is auto-updated whenever any change occurs in the ListBox.
The Search Utility searches items in a List Box. The items belong to a Group selected by a ComboBox. The Search Results are displayed in another ListBox. By using Radio Buttons, you can choose whether to accumulate the results or empty it for new results only. By using a ComboBox you can choose to Search by Text ( Name ) or by Data ( Email ). Check Screen-Shot below.
I’ve also optimized the scripts by transforming repetitive actions into functions. In fact, there are more that can be optimized but I leave that to you. I’ve decided to not include data verification at this time.
Please Login or Register to download this file.
Upto this stage, we still use Text Files with each line containing only 2 data, i.e., one for Name and another Email only. So you can see that our Project need much more improvements if we want more features added.
Also please take note that, everytime you SHARE DATA between GROUPS or MAKE NEW GROUPS from a Search, there are overlaps of GROUP members. This basically means, an ITEM with the SAME INFO are SHARED across many groups. The problem is, when we edit the info of such item in 1 group, we also need to update the same item if it is hosted in other groups as well. This redundancy issue must be resolved.
The best and efficient way is to use SQLite or XML. With SQLite and XML, we can set unique IDs for every ITEM. When we edit an item which belongs to several groups, we update only once for all groups. Saves lots of time and avoids confusion. And the best thing of all is that, we can add more details for every item. We’ll see this in the next topic.


