QOUT

QOUT

Display a list of expressions to the console

Syntax

      QOUT([<exp list>]) --> NIL
          QQOUT([<exp list>]) --> NIL

Arguments

<exp list> : is a comma-separated list of expressions (of any data type other than array or block) to display to the console. If no argument is specified and QOUT() is specified, a carriage return/line feed pair is displayed. If QQOUT() is specified without arguments, nothing displays.

Returns

QOUT() and QQOUT() always return NIL.

Description

QOUT() and QQOUT() are console functions. These are the functional primitives that create the ? and ?? commands, respectively. Like the ? and ?? commands, they display the results of one or more expressions to the console.

QOUT() outputs carriage return and line feed characters before displaying the results of <exp list>. QQOUT() displays the results of <exp list> at the current ROW() and COL() position. When QOUT() and QQOUT() display to the console, ROW() and COL() are updated.

If SET PRINTER is ON, PROW() and PCOL() are updated instead. If <exp list> is specified, both QOUT() and QQOUT() display a space between the results of each expression.

You can use QOUT() and QQOUT() for console display within an expression. This is particularly useful for blocks, iteration functions such as AEVAL() and DBEVAL(), and in a list of statements in the output pattern of a user-defined command definition.

Examples

      .  This example uses QOUT() with AEVAL() to list the contents of
      a literal array to the console:
      LOCAL aElements := { 1, 2, 3, 4, 5 }
      AEVAL(aElements, { |element| QOUT(element) })

Seealso

?|??, @…SAY, SET ALTERNATE, SET CONSOLE, SET PRINTER

DispOutAt

DispOutAt

Displays a value on the screen

Syntax

      DispOutAt( <nRow>      , ;
                    <nCol>      , ;
                    <expression>, ;
                    [<cColor>]  , ;
                    [<lSetPos>]   ) --> NIL

Arguments

<nRow> : Row number of screen to <expression> write

<nCol> : Column number of screen to <expression> write

<expression> : Any expression to write to the screen.

<cColor> : Color string for display

<lSetPos> : Specifies whether or not to update the screen cursor positions ( Row(), Col() after writing

Return

DispOutAt() returns always NIL.

Description

This function write the value of <expression> at the specified cursor position on the screen, using the color <cColor>, if specified.

Note

DispOutAt() don’t obey SET DEVICE setting and write always to the screen

Example

      DispOutAt( 0, 0, "Here upper left corner of screen", "W+/R" )

         is equvalent to :

         @ 0,0  SAY ""Here upper left corner of screen" COLOR  "W+/G"

Seealso

@ … SAY, Col(), DevOut(), DispBegin(), DispCount(), DispEnd(), DispOutAt(), OutStd(), QOut() | QQOut(), Row(), SetPos()

DispOut

DispOut

Displays a value on the screen

Syntax

      DispOut( <expression>, [<cColor>] ) --> NIL

Arguments

<expression> : Any expression to write to the screen.

<cColor> : Color string for display

Return

DispOut() returns always NIL.

Description

This function write the value of <expression> at the current cursor position on the screen, using the color <cColor>, if specified.

Note

DispOut() don’t obey SET DEVICE setting and write always to the screen

Example

      SetPos( 0, 0 )
         DispOut( "Here upper left corner of screen", "W+/R" )

         is equvalent to :

          @ 0,0  SAY ""Here upper left corner of screen" COLOR  "W+/G"

Seealso

@ … SAY, Col(), DevOut(), DispBegin(), DispCount(), DispEnd(), DispOutAt(), OutStd(), QOut() | QQOut(), Row(), SetPos()

DispEnd

DispEnd

Display buffered screen updates

Syntax

      DispEnd() --> NIL

Returns

DispEnd() always returns NIL.

Description

DispEnd() is a screen function that informs the Harbour display output system that the application has finished performing a series of display operations.

DispEnd() is used with DispBegin() so the display output system can buffer display updates. This can be important for applications in which complex screen displays are slow and the appearance of performance is desired.

Examples

      .  This example buffers screen output, updates the screen, and
      then displays the buffered screen output:

      DispBegin()            // Start screen buffering
      //
      SetPos(10, 10)
      DispOut("A display update")
      SetPos(11, 10)
      DispOut("Another display update")
      //
      DispEnd()               // Display buffered screen data

Seealso

DispBegin(), DispCount()

DispCount

DispCount

Return the number of pending DispEnd() requests

Syntax

      DispCount() --> nDispCount
     

Returns

DispCount() returns the number of DispEnd() calls required to restore the original display context.

Description

You can use DispCount() to determine the current display context. Harbour uses display contexts to buffer and to supervise screen output operations.

Each call to DispBegin() defines a new display context. Output to the display context is suppressed until a matching DispEnd() statement executes.

Since you may nest DispBegin() calls, use DispCount() to determine whether there are pending screen refresh requests.

Examples

      .  This example saves the setting of DispCount(), then releases
      all pending display contexts before writing to the screen:
      
      PROCEDURE ForceDisplay(cExp)
         LOCAL nSavCount
         
         nSavCount := DispCount()
         
         //  Discard pending display contexts
         DO WHILE ( DispCount() > 0)
            DispEnd()
         ENDDO
         
         DispOut(cExp)
         
         //  "Rewind" the current display context
         DO WHILE (DispCount() < nSavCount )
            DispBegin()
         ENDDO
      RETURN
     

Seealso

DispBegin(), DispEnd()

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