Introduction Video Functions


 Working With Video Functions

     This module discusses video functions that are either directly or
     indirectly concerned with the screen.  Included are all functions that
     deal with such screen adapters as CGA, EGA and Hercules.  Different
     modes on various adapters are supported, such as a 40-column CGA, a 43-
     line EGA, or a 50-line VGA.


     Many of the functions in this chapter depend on setting the DSETWINDOW()
     switch.  This switch determines if the screen output of external
     programs, as well as DOS, are redirected to a window.
     Clipper Tools output functions are also valid as external.  If the
     default setting in DSETWINDOW() is .T. or on, this rerouting is carried
     out.  Some functions will then return inaccurate, or at the very least,
     different results.  Examples of this are ISANSI() or NUMCOL()


     Many of the functions in this module work with color attributes
     designated as parameters.  These arguments are carried out in three
     different ways:

     A numeric value, which corresponds to a combined color attribute
     (e.g., 7).

     A string in the "NN/NN" form, with two specified numeric values (e.g.,

     A string in the "CC/CC" form, with two specified attributes are
     designated in the form Clipper requires (e.g., "W/N").

     With many functions, the attribute returns a combined numeric value.
     Attributes for the foreground and background are tied together this way.

     Color attributes are constructed as follows:

     Bit                8 7 6 5        4 3 2 1
     Attribute          * R G B        + R G B
           _ _ _ _ _ _  /   _ _ _ _ _ _

           Background   /   Foreground

     Each attribute consists of four bits, which represent a value in the
     range of 0 to 15.  Therefore, there are a total of 16*16, or 256,
     different values from 0 to 255.  These numeric values can be changed
     into the "nn/nn" format, that can be used under Clipper with the
     NTOCOLOR function.  However, it is possible to directly influence this
     combined attribute value.  The following examples show this and relate
     back to the chapter on number and bit manipulation:

     NUMOR( nattr, 128)    // Flashing on
     NUMAND(nattr, 127)    // Flashing off
     NUMXOR(nattr, 128)    // Change flashing
     NUMOR(nattr,  8)      // High intensity on
     NUMAND(nattr, 247)    // High intensity off
     NUMXOR(nattr,  8)     // Switch high intensity

 Special Parameter Type

     With many functions, a parameter may be of the <mIcCharacter|nCharacter>
     type (e.g., an individual character).  This can occur in two different

     Numerically, as the ASCII code of the desired character (e.g., 7).

     Alphanumeric as the character (e.g., ":").

     Because of this, you must not use the CHR() function to change special


     Some of the Clipper Tools functions use a standard attribute and
     character to  delete lines or screen areas.  This attribute is described
     as CLEARA; the character as CLEARB.  You can query both CLEARA and
     CLEARB with the corresponding functions.  At the same time, certain
     preset values are in effect for CLEARA and CLEARB.  The attribute "W/N"
     is the standard preset for CLEARA, while CHR(255) is the character used
     for CLEARB.  If you use this character for CLEARB, it fills the
     background with the corresponding color for every deletion on every
     screen adapter.

     Use the following functions to set standard values for CLEARA and


     If you use the SETCLEARx() functions in conjunction with the
     corresponding parameters (<Attribute> or <Character>), the currently
     existing default value is replaced by a parameter.

 Clipper Functions and Commands Which Delete

     If you use the Clipper Extended Drivers, CHR(255) is used instead of
     a space for all Clipper functions and commands that delete the screen
     in one way or another (see CLEARB).  A CHR(255) is helpful on many
     screen adapters, since in contrast to a space, you can assign it a
     color.  Then, the screen will not appear so fuzzy.

     More precisely, the functions and commands concerned always use the
     delete character set by SETCLEARB(), which uses CHR(255) as the default
     setting.  If you want to use a space to clear in Clipper or
     Clipper Tools, insert a SETCLEARB(32) into the program.

     Re-implement a space for clear:

        CLEAR         // The affected Clipper command

 Video Modes

     Occasionally, there is some confusion about video modes.  You will not
     be able to work in EGA mode just because your computer has an EGA
     adapter built into it.  By the same token, you will not get either EGA
     or VGA modes, if you do not work with graphics.

 EGA43 / VGA50 / VGA28, etc.

     In this section, the concern is not to just get a mode "hardwired"' into
     a card, but for Clipper Tools it is to generate corresponding fonts
     and other settings.  For these reasons, the GETMODE() and GETSCRMODE()
     functions generate their own values that are greater than 255.

     For example, changes to the screen mode concerned with line count can be
     combined with a 40-column mode:

     EGA43()          // 43 lines and 40 columns

 Video Functions and Windows

     You cannot implement functions that change the base address for screen
     memory while windows are open.  This includes all mode changes, as well


      Since this section is about DOS-TEXT mode programming, considered as obsolete and details skipped.

Tools – Extended Drivers

Introduction Extended Drivers
CGA40()      Switches to 40-column mode (color or monochrome)
CGA80()      Switches to 80-column mode (color or monochrome)
DSETKBIOS()  Turns the extended keyboard mode on or off through BIOS
DSETNOLINE() Ignores the next line feed sent to the screen
DSETQFILE()  Creates a protocol file when the program ends normally
DSETTYPE()   Determines the size of the keyboard buffer (SET TYPEAHEAD TO)
DSETWINDEB() This function is no longer supported
DSETWINDOW() Reroutes external functions and programs to a window
EGA43()      Switches to the 43-line EGA mode
FIRSTCOL()   Sets the first visible column of a virtual screen
FIRSTROW()   Sets the first visible line of a virtual screen
GETBOXGROW() Gets the time delay with which boxes are opened
GETCURSOR()* Determines the setting for the cursor form
GETKXLAT()   Determines the current key code table
GETKXTAB()   Retrieves the entire key code table
GETLINES()   Determines number of lines after which screen display pauses
GETMODE()    Uses the current screen mode as a function name
GETPAGE()    Determines the current screen page
GETPBIOS()   Determines if printing is through DOS or the BIOS
GETPXLAT()   Retrieves the current printer table
GETSCRMODE() Determines the number of the active video mode
GETTAB()     Retrieves tab values for CA-Clipper screen output
INKEYTRAP()  Behaves like INKEY() with support for key traps
INPUTMODE()  Determines previously active or currently active input mode
KEYREAD()    Reads already processed CA-Clipper keyboard buffer input
KEYSEND()    Simulates Clipper keyboard buffer input
MAXCOL()     Extends the Clipper MAXCOL() function
MAXPAGE()    Determines the number of available screen pages
MAXROW()     Extends the Clipper MAXROW() function
MONOCHROME() Switches to the monochrome mode
PAGECOPY()   Copies one screen page to another
PRINTERROR() Returns the error code for the last printer output
SETBELL()    Sets the tone frequency and duration for CHR(7)
SETBOXGROW() Opens boxes with a time delay
SETCURSOR()  Sets the cursor form
SETKXLAT()   Redefines key codes or lock keys
SETKXTAB()   Installs key tables
SETLINES()   Determines number of lines after which screen display pauses
SETMAXCOL()  Sets the number of columns for a virtual screen
SETMAXROW()  Sets the number of lines for a virtual screen
SETPAGE()    Selects a new screen page
SETPBIOS()   Redirects print output to BIOS or DOS, and establishes timeout
SETPXLAT()   Establishes translation tables for printer output
SETQNAME()   Changes the file and path name for the QUIT file
SETSCRMODE() Establishes a new video mode
SETTAB()     Sets the tab widths for CA-Clipper screen outputs
TRAPANYKEY() Calls a procedure with any keyboard input
TRAPINPUT()  Allows supervision of CA-Clipper input commands
TRAPSHIFT()  Calls a procedure that depends on switching keys
VGA28()      Switches to 28-line VGA mode
VGA50()      Switches to 50-line VGA mode.