Gilbert,
Are you saying that the posted code solved your problem?
If so, then referring to this code:
- Code: Select all Expand view
//oLB:Refresh() // This made our search slow, because after every
oLB:select(0)
oLB:select(1) // This also does the trick for a refresh
Are you saying that oLB:select(0) followed by oLB:select(1) is faster than oLB:refresh()? If so, did you time it and what was the speed difference?
You might also consider checking the time between keystrokes (using a static) and only refreshing if a certain time period has elapsed since the last keystroke. This way the user could quickly type in a string and only get one refresh when they either stop typing or pause.
Also, I would think that when the key is a value like a name, it is more useful for a refresh after each keystroke, since the user might be looking for the right one from the list. But when typing it a number code, usually the user knows exactly which code they need and they don't need to make a judgement call based on similar entries, so a dynamic search is less useful and speed might be a more important consideration.
This might also be interesting. I just was reading about a high-rise building that was built and the occupants were complaining that the wait for an elevator was too long. The architects reevaluated the building design but could not figure a way to add more elevators or make them move faster. So they called in a interior designer. The interior designer put several full-length mirrors near each elevator entrance and the complaints stopped. It seems that the people waiting for the elevator now had something to do while waiting so the wait didn't seem as long. They were busy either looking at themselves or others while waiting.
It points out how we might be able to make a wait seem shorter by some means such as distraction.
Regards,
James