
                          
                             BUFFKEY.BAS   ۱
                          ۱ 
                            

                         Sat  03-19-1994  22:41:19

     QuickBASIC 4.5 has the following few keyboard input commands:

     1.   INPUT          gives you the infamous "redo from start"
                         if a number or comma is entered for a string

     2.   LINE INPUT     No way to control length or kind

     3.   INKEY$         Requires a LOOP and a lot of programming.

     4.   INPUT$()       Similar to INKEY$ without the loop.

     None of these is grand for getting a controlled number or kind of
     key strokes from the program user. Especially if you -really- want
     and need to control the user's input to a fixed number of
     characters. A -too large- part of my uphill struggle with this
     language has been... and continues to be keyboard input problems.

     As I try to learn about Assembly, I realize that Assembly is
     WORSE!!! Far worse, but... in reading about Assembly, I discovered
     that MS-DOS does have a little INTERRUPT Function that allows you
     to enter keystrokes of up to 253 characters and EDIT them using the
     regular ol' MS-DOS editing keys (left cursor key, the backspace
     key... etc.).

     That Function is called "Buffered Keyboard Input." With it you set
     the total number of characters that can be returned in a string. If
     the user exceeds them, the computer beeps and does not permit
     another key stroke.... Gorsh and GOLLY.... error detection from
     MS-DOS!

     When you hit {Enter}, you are finished and your variable contains
     the characters you entered which you can display and use as a
     variable! How Great and easy....!

     BUFFKEY.BAS demonstrates the "Buffered Keyboard Input" MS-DOS
     Function. BUFFKEY.BAS uses the Function &HA with INTERRUPT &H21 to
     allow you to edit a string =independent= of QuickBASIC's klutzy
     INPUT or LINE INPUT commands -and- avoids having to write a
     complicated line editing program with INKEY$ or INPUT$().

          ͻ
                                                            
            BUFFKEY.BAS is a slick and simple line editor!  
                                                            
          Ľ

     REFERENCES:

     1.  Norton's PC Programming Bible, 1993, Microsoft Press, page 366
     2.  QuickBasic Programming Toolbox, JJ Craig, 1991, Microsoft Press

     John De Palma on CompuServe 76076,571
