|
| [WD] Search after a short delay |
| Iniciado por guest, 25,jun. 2015 10:05 - 1 respuesta |
| |
| | | |
|
| |
| Publicado el 25,junio 2015 - 10:05 |
Hi,
for searching articles or contacts the user has to enter a value in a textbox. If the length of the value is greater than 3 letters the search starts. The code for searching is executed in the 'whenever modifying' procedure of the textbox. This is suboptimal. The better way would be not to execute the search code in 'whenever modifying' while the user is typing but when he stopped entering letters. If he didnt enter letters for a second the search code should be executed.
How can i do this? Can you give me a hint?
Greetings Markus |
| |
| |
| | | |
|
| | |
| |
| Publicado el 25,junio 2015 - 11:25 |
Hi
One trick is to define a global/ in the window variable, say lastpressed Then a timer procedure
Whenever modifying ... Lastpressedtime = now() Procedure CheckTime_timer() if timedifference(lastpressedtime,Now()) > 100 then //100 is 1 second Do_Search() end Note: code is not tested 
Cheers Tor-Bjarne |
| |
| |
| | | |
|
| | | | |
| | |
|