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

Advertisements

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