Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

SET TYPEAHEAD, Set(“TypeAhead”)

SET TYPEAHEAD determines the maximum number of characters Visual FoxPro can capture and hold for the next input event.

Usage

SET TYPEAHEAD to nKeyStrokes
nKeyStrokes = SET("TYPEAHEAD")

Parameter

Value

Meaning

nKeyStrokes

Numeric

How many characters Visual FoxPro will buffer.

Legitimate values to supply range from zero to 32,000, according to the documentation. The default is 20, enough for all but the fastest typists. We haven’t tried to test the upper range, and can’t imagine why you’d want to hold on to that many. Setting TYPEAHEAD to 0 means that Visual FoxPro doesn’t preserve any characters for the next input event, effectively disabling the INKEY() function and ON KEY commands. Functions and methods only available within an input event (such as the KeyPress event) are not affected, since the READ EVENTS in effect immediately picks up any key pressed.

Example

SET TYPEAHEAD TO 0 && clear the buffer
SET TYPEAHEAD TO 100 && for real fast typists!

See Also

Clear TypeAhead, InKey(), On Key