Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Library for Clipper - <b>printer and keyboard functions</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
                     PRINTER and KEYBOARD FUNCTIONS


   Keyboard

   These keyboard functions simply allow for the checking of those non-
   printable keys and allow for the changing of the state of the Numlock,
   CapsLock and Scroll Lock keys.

   The functions make use of documented memory locations which are used
   by the ROM BIOS.

   Apart from testing for those non-printable keys of ordinary keyboards
   the functions also allow the programmer to test for Right Ctrl and
   Right Alt keys more recently found on the larger keyboards.

   As the keyboards installed appear not to be easily discernible it is
   recommended that care be taken when using L_ISALTR() and L_ISCTRLR().

   The function L_KYBDSTAT() returns the status of various keys so that
   key combinations may be checked for.

   Finally, care should also be taken when using the L_PRTSCRN()
   function.  Whilst this function will produce a screen dump to the
   printer not all graphics images will be reproduced as they appear
   visually on many printers. Many graphics screens have bit 7 of the
   character set. This makes it a graphics character instead of an
   ordinary character.

   Not all printers however will recognise these high characters and the
   result may be garbage.  Loading the memory resident GRAPHICS program
   from the DOS prompt will cause the graphics output to be sensible
   provided that an IBM compatible printer is attached.


   Printer

   These simple but useful functions allow output to be redirected
   between serial and parallel ports.  As can be seen from the source
   code the functions make use of documented memory locations containing
   the addresses of the code governing the serial and parallel ports.
   There are no DOS or ROMBIOS function calls which automatically allow
   the redirection of output between these ports.

   As the functions stand they do not keep track of which printer is
   selected. More to the point there is no immediate way to determine
   whether LPT1 has been redirected to COM1 which has since been
   redirected to LPT2.

   The functions have been mainly provided to address the need to that
   sometimes arises to change output without being too sophisticated.
   Like many of the functions in 'The Library' care must be taken when
   using them and be certain they work the way you expect before you
   rely on them as you would any toolkit you purchase.

   However, it is recommended that you redirect the output back to its
   original destination before redirecting it again to allow some form
   of management to be possible.

   A short program segment  is provided which toggles a flag each time it
   is called.  This means that the first time the function is called the
   flag will be changed and the next time it is called it will be reset
   to its original value.

            PUBLIC prn
            prn = "LPT1"
            swap_print()


            FUNCTION swap_print
            * toggle prn flag
              prn = IIF(prn="LPT1", "COM1", "LPT1")

            * Redirect output
              L_COM2LPT()
            RETURN(.T.)


   The functions are not intended to be regarded as communications
   functions.  As can be seen from the source code many of the functions
   call the ROM BIOS for information and many of you familiar with the
   ROM BIOS may be aware that the ROM BIOS functions can return
   information about the state of modems and various other peripherals
   if they exist.  These functions do not offer those facilities.

   Finally, please note that when specifying port values, serial or
   parallel, they start at zero.  Therefore COM1 and LPT1 are both
   referenced by the value 0.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson