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

DispBegin

DispBegin

Begin buffering screen output

Syntax

      DispBegin() --> NIL

Returns

DispBegin() always returns NIL.

Description

DispBegin() is a screen function that informs the Harbour display output system that the application is about to perform a series of display operations.

Use DispBegin() with DispEnd() to allow the display output system to buffer display updates. Display output which occurs after DispBegin() but before DispEnd() is allowed to accumulate in internal buffers. When DispEnd() executes, any pending updates appear on the physical display. This is useful in applications where complex screen displays are slow and the appearance of performance is desired.

DispBegin() and DispEnd() calls are optional. They are not required for normal output.

Notes

. Nested calls: DispBegin() calls are nested internally. If several DispBegin() calls occur, buffering is allowed until a corresponding number of DispEnd() calls occur.

. Guaranteed operations: Display updates performed between DispBegin() and DispEnd() are not guaranteed to be buffered–some updates may become visible before DispEnd() is called. However, all updates are guaranteed to be visible after the closing call to DispEnd().

. Terminal operations: Terminal input operations such as INKEY() or READ should not be performed between DispBegin() and DispEnd(). Doing this may cause input or display output to be lost.

. Incompatible operations: Display output by other than the Harbour display functions (e.g., by add-on libraries or by DOS via OUTSTD(), etc.) may not be compatible with DispBegin() and DispEnd(). Output may be lost.

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

DispCount(), DispEnd()

DevPos

DevPos

Moves the cursor or printhead to a row and column coordinate

Syntax

      DevPos( <nRow>, <nCol> ) --> NIL

Arguments

@ <nRow>, <nCol> : Coordinates for write; screen of printer depending to SET DEVICE setting.

Return

DevPos() returns always NIL.

Description

<nRow>, <nCol> are row and column coordinates and positions the screen cursor or printhead accordingly. Coordinates begin at point 0, 0 which is the upper left corner of the screen, or paper.

IF DEVICE SETted to SCREEN, DevPos() moves the screen cursor to the specified coordinates and updates Row() and Col().

IF DEVICE SETted to PRINTER, DevPos() moves the printhead to the new row and column coordinate and updates PRow() and PCol().

Notes

SetPrc() adjust the internal counters of PRow() and PCol().

When printer output is redirected to a file by SET PRINTER TO command, DevPos() output is recorded in that file.

Seealso

@…SAY, Col(), DevOut(), PCol(), PRow(), QOut() | QQOut(), ROW(), SET DEVICE, SetPos(), SetPrc()

DevOutPict

DevOutPict

Writes a PICTURE formatted value to the current device.

Syntax

      DevOutPict( <expression>, <cPicture> [,<cColor>] ) --> NIL

Arguments

<expression> : Any valid expression to write to the device assigned by SET DEVICE command

<cPicture> : A valid PICTURE format string.

<cColor> : A valid color codes string for value to write. Default is current color setting

Returns

DevOutPict() always returns NIL

Description

DevOutPict() is a console function that outputs the value of an expression to the screen or the printer with defined PICTURE and color. Output device depens on current device.

Example

      DevOutPict( CUST->DEBIT, "99,999.99" )

Seealso

@…SAY, Col(), DevOut(), DevPos(), QOut() | QQOut(), Row(), SET DEVICE, SetPos(), Transform()

DevOut

DevOut

Writes a value to the current device

Syntax

      DevOut( <expression>, [<cColor>], [<nRow>, <nCol>] ) --> NIL

Arguments

<expression> : Any valid expression to write to the device assigned by SET DEVICE command

<cColor> : A valid color codes string for value to write. Default is current color setting <nRow> and

<nCol> : Row and column value for device to write <expression>. Defaults is ROW() and COL() if current device is screen and PRow() and PCol() for the printer.

Return

DevOut() returns always NIL

Description

DevOut() is a console function that outputs the value of an expression to the screen or the printer depending on current device.

Example

      // Write a string at upper left corner of screen :

      DevOut( "Here is upper left corner", "W+/R", 0, 0  )

        Equivalent usage :

      @ 0, 0 SAY "Here is upper left corner" COLOR "W+/R"

Seealso

@…SAY, Col(), DevOutPict(), DevPos(), QOut() | QQOut(), Row(), SET DEVICE, SetPos()