STACK.BAS (with compiled .EXE program included) is a QB program to demonstrate
how to use INTERRUPT 16h to stack keystrokes into the keyboard buffer.  As
currently written, it will only support keystrokes with ascii codes between
32 and 126, i.e., the standard ascii character set.  (But see CSTACK and
ASTACK.)  The syntax for using STACK.EXE is

STACK text-string-to-be-sent-to-keyboard-buffer

(For example,

STACK DIR *.DAT

will put a command to show all .DAT files in the current directory on the
screen into the keyboard buffer.)  Normally, a carriage return is also
sent to the buffer at the end of the text you put on the command line.  If
you want to suppress stacking the carriage return, put a semicolon (";")
at the end of your text string.  If you want to actually include a trailing
semicolon in the text to be stacked, use two semicolons (";;") together.
(A carriage return will also be stacked in this instance.)  One constraint
of this program is that you can only stack about 14 or 15 keystrokes before
filling the keyboard buffer.  Another constraint is due to the fact that
the way QB uses the COMMAND$ variable to store the command line text, your
text following the STACK command is converted to uppercase.  I've programmed
a gimmick, however, that will let you stack lowercase letters.  If you want
to stack a lowercase letter, hold the CONTROL key down while you're typing
the letter following STACK on the DOS command line.  (This won't work for
stacking a "c"--or in any situation in which you have a TSR which attaches
specific importance to some "CONTROLled character.)

With all of that out of the way, the programs ASTACK and CSTACK are similar.
ASTACK stacks ALTernate keystrokes.  The command line syntax is the same
as with STACK, but only the numerals 0 - 9 and letters A - Z (or a - z)
are relevant.  (The other keys don't have ALTernates.)  For example,

STACK B

stacks an ALT-B and

STACK fo

stacks an ALT-F and then an ALT-O.  (Carriage returns are not stacked.)
Of course, in order to see any effect of stacking an ALT key, there has
to be some other program taking input from the keyboard buffer as you
put ALT keystrokes into it.  (Nothing shows up on the DOS screen.)  CSTACK
does the same thing for CONTROL keystrokes (only the letters A - Z, or a - z,
apply).  Again, carriage returns are not stacked with CSTACK.

The technique used by STACK/ASTACK/CSTACK may not work if you have an IBM XT.
However, the book that I learned how to do this from said it requires an
AT or better with an "enhanced" (i.e., enyucked) keyboard.  But I have an
AT without such a keyboard and STACK and ASTACK work fine.  (And the problem
with CSTACK cannot be attributed to this because it doesn't work any
differently on a 486 with an "enhanced" keyboard.)

If you should want to modify the .BAS source code and recompile it, when
you go to LINK it, you need to use the "auxiliary library" QB.LIB.

Glenn Stumpff
73137,3537
