HELP! Left clicking a listbox item and input not working correctly

Recommended Posts

king9072 0

king9072 0

Hey all brief summary of my situation, I own a franchise and instead of keeping customer loyalty cards (as we previously did which got very hectic with 2000+ cards to track), I have decided to write a program that I can catalog all customers and update their current count.

So, since I am learning this language as I go since yesterday you will probably see that I have done some mindless things in my script which could have been avoided using complex variables and functions etc, but I don't mind writing more code than needed if it gets the job done.

Now my issue, I have everything working almost as necessary but when I search for a customer if only one name matches the search it will pop open a dialog for me to edit that one users details which works well. BUT my issue is that when a search returns more than one name, I have it display the results in a listbox. Now what I wish to do from there is be able to simply double click an entry and from there popup an input box similar to the one which comes up when only one name is returned.

To see what I mean, run my script and search for "dave" since the customer db only has one dave, it pops up the proper dialog so that person can be edited. Now search for steve and it will load the listbox with all the steves.

Also, for the program to work (again back to me being a rookie at this) it requires 3 text files, one for customers, 1 for how many cards, and 1 for how many total cards they have completed. Yes I know I could eliminate this with a proper array, but that stuff is a little beyond me at this point and this system works fine for me now. These files need to be in scriptdir.

Edit: You will notice that I have an edit customer button, I origonally planned for this but now that I am thinking about it, it would practically be identical to the search button. So if it makes it any easier, it would be nice of clicking that button edited the highlighted item in the listbox thanks!

EDIT: Just letting you know I have spent all day searching the forums looking for answers as well as I am continuing to do that now. Another additional bug that I cant seem to completely fix is

if you remove the sleep (search my code) for some reason the search quits working all together, it simply exits the input and remains at the gui... doing nothing.... but simply adding a sleep INSTANTLY fixes it, it is also fixed if instead of putting the sleep I do a _arraydisplay, I guess just having the script pause a second seems to get the script working properly. But without that pause it does not work.