DispBox

DispBox

Displays a box on the screen.

Syntax

      DispBox( <nTop>, <nLeft>, <nBottom>, <nRight>, ;
             [<cnBoxString>] , [<cColor>] ) --> NIL

Arguments

<nTop> and <nLeft> : screen coordinates for the upper left corner of the DispBox()output

<nBottom> and <nRight> : screen coordinates for the lower right corner of the DispBox()output

<cnBoxString> : The appearance of the box to display can either be specified as numeric 1 (single line box), numeric 2 (double line box), or as a character string holding up to nine characters. The first eight characters define the border of the box while the ninth character is used to fill the box. #define constants to be used for <cnBoxString> are available in the BOX.CH #include file.

Pre-defined box strings for DispBox()

         Constant        Description
         --------------- ----------------------------------------
         B_SINGLE        Single-line box
         B_DOUBLE        Double-line box
         B_SINGLE_DOUBLE Single-line top, double-line sides
         B_DOUBLE_SINGLE Double-line top, single-line sides

If no <cnBoxString> is specified, a single-line box is drawn. <cColor> : SetColor() compliant color string; default is the standard color of SetColor().

Return

DispBox() returns always NIL.

Description

The function DispBox() displays a box on the screen as specified with <cnBoxString>, using the standard color of SetColor() or <cColor>, if specified.

If a character string is used for <cnBoxString>, the first eight characters define the border of the box in clockwise direction, beginning with the upper left corner. An optional ninth character fills the area inside the box. Alternatively, a single character can be passed which is used to draw the entire box border. When the box is completely drawn, the cursor is positioned at the coordinates <nTop>+1 and <nLeft>+1, so that a subsequent DispOut() call starts displaying in the upper left corner of the box area.

Example

      // The example demonstrates how characters are used to draw a box.
      // Alphabetic characters define <cnBoxString> instead of characters
      // holding graphic signs.

      #include "Box.ch"

      PROCEDURE Main
         CLS
         DispBox( 10,10,20,50, "AbCdEfGhi", "W+/R" )

         Inkey(0)

         DispBox( 10,10,20,50, B_DOUBLE + Space(1) )
         DispOut( "Using #define constant" )

         @ MaxRow(),0
      RETURN

Seealso

@…BOX, @…CLEAR, @…TO, Scroll(), SetColor()

SET TYPEAHEAD

SET TYPEAHEAD

Set the size of the keyboard buffer

Syntax

      SET TYPEAHEAD TO <nKeyboardSize>

Arguments

TO <nKeyboardSize> specifies the number of keystrokes the keyboard buffer can hold from a minimum of zero to a maximum of 4096. The default size of the keyboard buffer is machine-dependent but 16 is the minimum size.

Description

SET TYPEAHEAD defines the size of the Clipper keyboard buffer that caches keystrokes input directly by the user. SET TYPEAHEAD, however, does not affect the number of characters that can be stuffed programmatically using the KEYBOARD command. When executed, SET TYPEAHEAD clears the keyboard buffer and sets the size to <nKeyboardSize>.

When TYPEAHEAD is SET TO zero, keyboard polling is suspended. An explicit request for keyboard input, however, will temporarily enable the keyboard and read any pending keystrokes from the BIOS buffer. Calling NEXTKEY() constitutes such an explicit request. NEXTKEY() reads any pending keystrokes from the BIOS buffer and returns the INKEY() value of the first keystroke read, or zero if no keystrokes are pending.

Seealso

ALTD(), CLEAR, TYPEAHEAD, INKEY(), KEYBOARD, NEXTKEY()

CLEAR SCREEN

CLEAR SCREEN

Clear the screen and return the cursor home

Syntax

      CLEAR [SCREEN] | CLS

Arguments

SCREEN suppresses the automatic releasing of Get objects from the current and visible GetList array when the screen is CLEARed.

Description

CLEAR is a full-screen command that erases the screen, releases pending GETs, and positions the cursor at row and column zero. If the SCREEN clause is specified, Get objects are not released.

CLS is a synonym for CLEAR SCREEN.

Notes

. SET KEY and VALID: If you are editing GETs, executing a CLEAR within a SET KEY procedure or within a VALID user-defined function will abort the active READ when control returns. To clear the screen without CLEARing GETs, use either the CLEAR SCREEN or CLS commands.

Seealso

@…CLEAR, CLEAR GETS, SCROLL()

CLEAR GETS

CLEAR GETS

Release Get objects from the current GetList array

Syntax

       CLEAR GETS

Description

CLEAR GETS explicitly releases all Get objects in the current and visible GetList array, and terminates the calling READ, releasing any remaining objects in the calling READ, if executed within a SET KEY procedure or a user-defined function invoked by a VALID clause. CLEAR GETS releases Get objects by assigning an empty array to the variable GetList. GetList is the name of the variable used to hold an array of Get objects for subsequent READ commands. There are two other mechanisms that automatically release Get objects: CLEAR specified without the SCREEN clause, and READ specified without the SAVE clause.

CLEAR GETS has two basic uses. First, it can be used to terminate a READ from a SET KEY procedure or VALID user-defined function. Second, it can be used to delete Get objects from the GetList array when you have not executed a READ or you have saved the Get objects by using READ SAVE.

Seealso

@…CLEAR, @…GET, CLOSE, READ, RELEASE, SET TYPEAHEAD

@…TO

@…TO

Draw a single- or double-line box

Syntax

       @ <nTop>, <nLeft>
              TO <nBottom>, <nRight> [DOUBLE] [COLOR <cColorString>]

Arguments

<nTop>, <nLeft>, <nBottom>, and <nRight> define the coordinates of the box. @…TO draws the box using row values from zero to MAXROW() and column values from zero to MAXCOL(). <nBottom> and <nRight> can be larger than the screen size, but output is clipped at MAXROW() and MAXCOL().

DOUBLE draws the box with a double line. If not specified, the box is drawn with a single line.

COLOR <cColorString> defines the display color of the drawn box. If not specified, the box is drawn using the standard color setting of the current system color as defined by SETCOLOR(). Note that <cColorString> is a character expression containing the standard color setting. If you specify a literal color setting, enclose it within quote marks.

Description

@…TO draws a single- or double-line box on the screen. If <nTop> and <nBottom> are the same, a horizontal line is drawn. If <nLeft> and <nRight> are the same, a vertical line is drawn.

After @…TO finishes drawing, the cursor is located in the upper-left corner of the boxed region at <nTop> + 1 and <nLeft> + 1. ROW() and COL() are also updated to reflect the new cursor position.

@…TO is like @…BOX except that @…BOX lets you define the characters of the box and supports a fill character. @…TO, however, is recommended for portability since it does not require the specification of hardware-dependent graphics characters.

Examples

       .  This example erases a region of the screen, then draws a box
       of the same size:

       @ 10, 10 CLEAR TO 20, 40
       @ 10, 10 TO 20, 40 DOUBLE COLOR "BG+/B"

Seealso

@…BOX, @…CLEAR, DISPBOX()

@…BOX

@…BOX

Draw a box on the screen

Syntax

       @ <nTop>, <nLeft>, <nBottom>, <nRight>
              BOX <cBoxString> [COLOR <cColorString>]

Arguments

<nTop>, <nLeft>, <nBottom>, <nRight> define the coordinates of the box. @…BOX draws a box using row values from zero to MAXROW(), and column values from zero to MAXCOL(). If <nBottom> and <nRight> are larger than MAXROW() and MAXCOL(), the bottom-right corner is drawn off the screen.

BOX <cBoxString> defines a string of eight border characters and a fill character. If <cBoxString> is specified as a single character, that character draws the whole box.

COLOR <cColorString> defines the display color of the drawn box. If not specified, the box is drawn using the standard color setting of the current system color as defined by SETCOLOR(). Note that <cColorString> is a character expression containing the standard color setting. If you want to specify a literal color setting, enclose it within quote marks.

Description

@…BOX draws a box on the screen using configurable border and fill characters. @…BOX draws the box using <cBoxString> starting from the upper left-hand corner, proceeding clockwise and filling the screen region with the ninth character. If the ninth character is not specified, the screen region within the box is not painted. Existing text and color remain unchanged.

After @…BOX executes, the cursor is located in the upper corner of the boxed region at <nTop> + 1 and <nLeft> + 1. ROW() and COL() are also updated to reflect the new cursor position.

Examples

       .  These examples draw two boxes using box manifest constants
       defined in the supplied header file, Box.ch.  The first example draws
       a box using the specified characters for the border, but leaves all
       other areas of the screen intact.  The second example draws the same
       box filling the box region with space characters.

       #include "Box.ch"
       // Draw a box with a double-line top with a
       // single-line side
       @ 1, 1, 22, 79 BOX B_DOUBLE_SINGLE
       // Draw the same box filling the box region with
       // spaces
       @ 1, 1, 22, 79 BOX B_DOUBLE_SINGLE + SPACE(1)

Files

Header file is Box.ch.

Seealso

@…CLEAR, @…TO, DISPBOX(), SCROLL()

C5_@…CLEAR

 @...CLEAR
 Clear a rectangular region of the screen
------------------------------------------------------------------------------
 Syntax

     @ <nTop>, <nLeft> [CLEAR
        [TO <nBottom>, <nRight>]]
        [DOUBLE] [COLOR <cColor>]

 Arguments

     <nTop> and <nLeft> define the upper-left corner coordinate.

     TO <nBottom>, <nRight> defines the lower-right corner
     coordinates of the screen region to CLEAR.  If the TO clause is not
     specified, these coordinates default to MAXROW() and MAXCOL().

 Description

     @...CLEAR erases a rectangular region of the screen by filling the
     specified region with space characters using the current standard color
     setting.  After @...CLEAR erases the designated region, the cursor is
     located in the upper corner of the region at <nTop> + 1 and <nLeft> + 1.
     ROW() and COL() are also updated to reflect the new cursor position.

 Examples

     .  This example erases the screen from 10, 10 to 20, 40, painting
        the region blue and then displaying a bright cyan box on blue:

        SETCOLOR("BG+/B")
        @ 10, 10 CLEAR TO 20, 40
        @ 10, 10 TO 20, 40

 Files   Library is CLIPPER.LIB.

See Also: @…BOX CLEAR SCREEN SCROLL() SETCOLOR()

 

C5 Commands

 ?|??            Display one or more values to the console
 @...BOX         Draw a box on the screen
 @...CLEAR       Clear a rectangular region of the screen
 @...GET         Create a new Get object and display it
 @...PROMPT      Paint a menu item and define a message
 @...SAY         Display data at a specified screen or printer row and column
 @...TO          Draw a single- or double-line box
 ACCEPT*         Place keyboard input into a memory variable
 APPEND BLANK    Add a new record to the current database file
 APPEND FROM     Import records from a database (.dbf) file or ASCII text file
 AVERAGE         Average numeric expressions in the current work area
 CALL*           Execute a C or Assembler procedure
 CANCEL*         Terminate program processing
 CLEAR ALL*      Close files and release public and private variables
 CLEAR GETS      Release Get objects from the current GetList array
 CLEAR MEMORY    Release all public and private variables
 CLEAR SCREEN    Clear the screen and return the cursor home
 CLEAR TYPEAHEAD Empty the keyboard buffer
 CLOSE           Close a specific set of files
 COMMIT          Perform a solid-disk write for all active work areas
 CONTINUE        Resume a pending LOCATE
 COPY FILE       Copy a file to a new file or to a device
 COPY STRUCTURE  Copy the current .dbf structure to a new database (.dbf) file
 COPY STRU EXTE  Copy field definitions to a .dbf file
 COPY TO         Export records to a database (.dbf) file or ASCII text file
 COUNT           Tally records to a variable
 CREATE          Create an empty structure extended (.dbf) file
 CREATE FROM     Create a new .dbf file from a structure extended file
 DELETE          Mark records for deletion
 DELETE FILE     Remove a file from disk
 DELETE TAG      Delete a tag
 DIR*            Display a listing of files from a specified path
 DISPLAY         Display records to the console
 EJECT           Advance the printhead to top of form
 ERASE           Remove a file from disk
 FIND*           Search an index for a specified key value
 GO              Move the pointer to the specified identity
 INDEX           Create an index file
 INPUT*          Enter the result of an expression into a variable
 JOIN            Create a new database file by merging from two work areas
 KEYBOARD        Stuff a string into the keyboard buffer
 LABEL FORM      Display labels to the console
 LIST            List records to the console
 LOCATE          Search sequentially for a record matching a condition
 MENU TO         Execute a lightbar menu for defined PROMPTs
 NOTE*           Place a single-line comment in a program file
 PACK            Remove deleted records from a database file
 QUIT            Terminate program processing
 READ            Activate full-screen editing mode using Get objects
 RECALL          Restore records marked for deletion
 REINDEX         Rebuild open indexes in the current work area
 RELEASE         Delete public and private memory variables
 RENAME          Change the name of a file
 REPLACE         Assign new values to field variables
 REPORT FORM     Display a report to the console
 RESTORE         Retrieve memory variables from a memory (.mem) file
 RESTORE SCREEN* Display a saved screen
 RUN             Execute a DOS command or program
 SAVE            Save variables to a memory (.mem) file
 SAVE SCREEN*    Save the current screen to a buffer or variable
 SEEK            Search an order for a specified key value
 SELECT          Change the current work area
 SET ALTERNATE   Echo console output to a text file
 SET BELL        Toggle sounding of the bell during full-screen operations
 SET CENTURY     Modify the date format to include or omit century digits
 SET COLOR*      Define screen colors
 SET CONFIRM     Toggle required exit key to terminate GETs
 SET CONSOLE     Toggle console display to the screen
 SET CURSOR      Toggle the screen cursor on or off
 SET DATE        Set the date format for input and display
 SET DECIMALS    Set the number of decimal places to be displayed
 SET DEFAULT     Set the CA-Clipper default drive and directory
 SET DELETED     Toggle filtering of deleted records
 SET DELIMITERS  Toggle or define GET delimiters
 SET DESCENDING  Change the descending flag of the controlling order
 SET DEVICE      Direct @...SAYs to the screen or printer
 SET EPOCH       Control the interpretation of dates with no century digits
 SET ESCAPE      Toggle Esc as a READ exit key
 SET EXACT*      Toggle exact matches for character strings
 SET EXCLUSIVE*  Establish shared or exclusive USE of database files
 SET FILTER      Hide records not meeting a condition
 SET FIXED       Toggle fixing of the number of decimal digits displayed
 SET FORMAT*     Activate a format when READ is executed
 SET FUNCTION    Assign a character string to a function key
 SET INDEX       Open one or more order bags in the current work area
 SET INTENSITY   Toggle enhanced display of GETs and PROMPTs
 SET KEY         Assign a procedure invocation to a key
 SET MARGIN      Set the page offset for all printed output
 SET MEMOBLOCK   Change the block size for memo files
 SET MESSAGE     Set the @...PROMPT message line row
 SET OPTIMIZE    Change the setting that optimizes using open orders
 SET ORDER       Select the controlling order
 SET PATH        Specify the CA-Clipper search path for opening files
 SET PRINTER     Toggle echo of output to printer or set the print destination
 SET PROCEDURE*  Compile procedures and functions into the current object file
 SET RELATION    Relate two work areas by a key value or record number
 SET SCOPE       Change the boundaries for scoping keys in controlling order
 SET SCOPEBOTTOM Change bottom boundary for scoping keys in controlling order
 SET SCOPETOP    Change top boundary for scoping keys in controlling order
 SET SCOREBOARD  Toggle the message display from READ or MEMOEDIT()
 SET SOFTSEEK    Toggle relative seeking
 SET TYPEAHEAD   Set the size of the keyboard buffer
 SET UNIQUE*     Toggle inclusion of non-unique keys into an index
 SET WRAP*       Toggle wrapping of the highlight in menus
 SKIP            Move the record pointer to a new position
 SORT            Copy to a database (.dbf) file in sorted order
 STORE*          Assign a value to one or more variables
 SUM             Sum numeric expressions and assign results to variables
 TEXT*           Display a literal block of text
 TOTAL           Summarize records by key value to a database (.dbf) file
 TYPE            Display the contents of a text file
 UNLOCK          Release file/record locks set by the current user
 UPDATE          Update current database file from another database file
 USE             Open an existing database (.dbf) and its associated files
 WAIT*           Suspend program processing until a key is pressed
 ZAP             Remove all records from the current database file

 

Introduction Video Functions

 Introduction

 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.

 DSETWINDOW()

     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()

 Attribute

     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.,
     "7/0").

     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
     ways:

     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
     characters.

 CLEARA and CLEARB

     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
     CLEARB:

        GETCLEARA()
        SETCLEARA()
        GETCLEARB()
        SETCLEARB()

     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:

        SETCLEARB(32)
        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:

     CGA40()
     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
     as SETPAGE and SETSCRSTR.

Note:

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

Clipper and Networking

Clipper and Networking