Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!elroy!cit-vax!tybalt.caltech.edu!ccwf From: ccwf@tybalt.caltech.edu (Charles C. Fu) Newsgroups: comp.sys.ibm.pc Subject: Re: Three questions Summary: A Plug for a Handy Keyboard Buffer Utility Message-ID: <9326@cit-vax.Caltech.Edu> Date: 29 Jan 89 05:04:48 GMT References: <719@krafla.rhi.hi.is> Sender: news@cit-vax.Caltech.Edu Reply-To: ccwf@tybalt.caltech.edu.UUCP (Charles C. Fu) Organization: California Institute of Technology Lines: 39 Please forgive me if I make any errors since this is my first posting. Over the past several weeks, articles have been posted asking questions about changing the size of the keyboard buffer, writing self-erasing batch files, changing between 25 and 43 line modes, doing screen dumps from within batch files, setting an environment variable to the current directory from within a batch file, etc.... A wonderful little ( <1K ) TSR program/utility has been written by one of the professors at Caltech which will do all of the above and more. Unfortunately, it is not public domain, but the cost is reasonable. The program is called STACKEY. Its primary function is to insert characters into the keyboard buffer. Thus, a batch file can contain a STACKEY command to add "del SAMPLE.BAT " to the buffer, and this string will be executed by DOS as soon as the batch file terminates. (The string is ECHOed to the screen, but you could include escape characters to make the string invisible.) Many metastrings are also available (like the current path and the date) so that these can be incorporated into strings to be put in the buffer. Finally, there is a large list of "special commands" which are executed immediately such as screen dump to printer or a file, turn cursor on/off, switch between 25 and 43 line mode (EGA only), switch monitors, switch LPT1/LPT2 or COMM1/COMM2, turn on/off Num lock/Caps lock/Scroll lock/ Ins, or even do a warm/cold reboot. Also, the keyboard buffer can be set to any length up to 64K or disabled entirely. (But wait, there's more! :-) Anyways, even if you don't look into the product (or write your own, after all STACKEY does all this and more with <1K of code), keep in mind the usefulness of the keyboard buffer. Stuffing strings into the buffer to be executed as soon as control returns to DOS may not be an optimal solution to your problems, but it is a straightforward easy-to- understand-and-debug method with many applications. -CCWF P.S. STACKEY can also do some cute things like stick a DEL character (displayed as a right-pointing arrow) in the prompt.