Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)
120 Chapter6
Typeahead Mode
Working in Typeahead Mode
Working in Typeahead Mode
By using the device controls described in this chapter, you can specify
whether or not typeahead mode is enabled when your program
executes. By allowing typeahead mode you can make it possible for the
user of the application to enter data that the user knows will be
required before the application actually requests the data.
Suppose, for example, that your program issues a series of questions
designed to allow an interactive user with the proper access codes to
gain entry to a database program. Without typeahead mode active, the
program writes each question on the user’s terminal screen and waits
for a reply. Each reply may require some additional processing before
the next question is written to the screen. In some cases, the delay
between questions may be quite noticeable.
If typeahead mode is on, however, a user who is familiar with the series
of questions can type replies to all of the questions at once, without
regard to processing delays. As long as the replies are entered in the
required sequence for the application and are separated from each
other by an end-of-record character (such as carriage return), they will
be accepted as valid replies.
After all of the replies have been entered, the user will still have to wait
for the application to process the replies before being granted access to
the database. But now all of the waiting is at the end of the question
sequence, and the user is free to perform some other task instead of
having to wait for the next question.
Enabling Typeahead Mode
As of version A.30.00 of MPE/iX, a terminal user can enable typeahead
mode at the Command Interpreter level for any supported terminal.
The command :SETVAR HPTYPEAHEAD TRUE enables typeahead, while
the command :SETVAR HPTYPEAHEAD FALSE disables typeahead.
(These commands replace the command file used to set typeahead mode
in earlier MPE/iX versions supporting typeahead.)
In order for typeahead to be used in an application, however, the
application itself must programmatically enable and manage
typeahead through the FDEVICECONTROL functions explained in
this chapter.
WARNING
No attempt should be made to use typeahead mode at a terminal that is
running an application which has not been specifically coded for
typeahead processing.