Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run code ONLY when users pauses on keyboard input?
Message
From
21/10/2004 11:46:59
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Run code ONLY when users pauses on keyboard input?
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00953351
Message ID:
00953351
Views:
61
I have a form that has a textbox used for a search function. Currently, as the user keys information into the search box (tSearch), a KeyPress and Interactive change method controls processing. Certain function keys, such as left arrow, right arrow, enter, etc are processed specifically by the KeyPress method. The interactive change causes a rather large FILTER statement to display specific records in a grid elsewhere on the page based on the string entered in tSearch.

The current function works well in that the grid constantly updates with only the relevant records that the "search" matches. The problem is, as the table grows, and now with the addition of having to filter on a 3rd field as well, the input is of course getting very sluggish... that is, the user can type 10 characters quickly and they appear at a slow rate as the filter updates with each.

What I was considering was a way for the filter to NOT fire until the users keypress input pauses... that is, when they stop typing for a specified amount of time. This way, the user could key the whole search string and when they stop, the grid will update.

Of course the easiest way would be to require an ENTER key or other specific key to actually do the search... the client would prefer not.

I thought about using some sort of processing based of the SECONDS() command but not sure in what method I would place the code... that is, if I put it in KeyPress or InteractiveChange then that code will only fire WHEN they press a key, not when they STOP keying.

Is there a way to do this that's not too extensive?

Thanks

Peter Brama
Peter Brama
West Pointe Enterprises

VFP is getting easier but STILL alot to learn!!
Next
Reply
Map
View

Click here to load this message in the networking platform