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

EJECT

EJECT

Issue an command to advance the printer to the top of the form

Syntax

      EJECT

Arguments

None

Description

This command issue an form-feed command to the printer. If the printer is not properly hooked up to the computer, an error will not be generated and the command will be ignored.

Once completed, the values of PROW() and PCOL(), the row and column indicators to the printer, will be set to 0. Their values, however, may be manipulated before or after ussuing an EJECT by using the DEVPOS() function.

On compile time this command is translated into __EJECT() function.

Examples

      Use Clientes New
      Set Device to Printer
      CurPos:=0
      While !Eof()
      ? Clientes->nome,Clientes->endereco
      Curpos++
      if Curpos >59
          Curpos:=0
          Eject
      Endif
      Enddo
      Set Device to Screen
      Use

Tests

      See examples

Compliance

Clipper

Platforms

All

Seealso

DEVPOS(), SET PRINTER, PROW(), PCOL()

C5_PROW

 PROW()
 Return the current row position of the printhead
------------------------------------------------------------------------------
 Syntax

     PROW() --> nRow

 Returns

     PROW() returns an integer numeric value that represents the number of
     the current line sent to the printer.  The beginning row position is
     zero.

 Description

     PROW() is a printer function that reports the row position of the
     printhead after the last print operation.  PROW() is updated only if
     either SET DEVICE TO PRINTER or SET PRINTER ON is in effect.  PROW() is
     like ROW() except that it relates to the printer rather than the screen.
     PROW() is updated in the following ways:

     .  Application startup sets PROW() to zero

     .  EJECT resets PROW() to zero

     .  A print operation sets PROW() to the last row print position

     .  SETPRC() sets PROW() to the specified row position

     PROW() used with PCOL() prints a value to a new row relative to the last
     row printed.  If the printhead is positioned to a new row with a control
     code, a line feed (CHR(10)), or form feed (CHR(12)), PROW() is not
     updated and, therefore, will not return the expected value.  To prevent
     this discrepancy, reset PROW() to the correct value with SETPRC() after
     sending any of these characters to the printer.

 Examples

     .  This example uses PROW() and SETPRC() to create a simple one-
        across label program that prints with @...SAY instead of ?:

        USE Customer INDEX CustName NEW
        SET DEVICE TO PRINTER
        SETPRC(2, 0)
        DO WHILE !EOF()
           @ PROW(), 3 SAY CustName
           @ PROW() + 1, 3 SAY RTRIM(City) + ",;
                  " + RTRIM(State) + ZipCode
           @ PROW() + 1, 3 SAY Phone PICTURE "@R ;
                 (999) 999-9999"
           SETPRC(2, 0)
           SKIP
        ENDDO
        SET DEVICE TO SCREEN
        CLOSE

 Files   Library is CLIPPER.LIB.

See Also: ?|?? @…SAY EJECT PCOL() QOUT() ROW()



CL5 Printing Commands, Statements and Funtions

?/?? :

Display or print one or more values to the console or printer

? | ?? [<exp list>]

@…SAY :

Display or print data at a specified screen or printer row and column

@ <nRow>, <nCol>
   [SAY <exp>
   [PICTURE <cSayPicture>]
   [COLOR <cColorString>]]
   [GET <idVar>
   [PICTURE <cGetPicture>]
   [COLOR <cColorString>]]
   [WHEN <lPreExpression>]
   [RANGE* <dnLower>, <dnUpper>] |
   [VALID <lPostExpression>]

DEVPOS() :

Move the cursor or printhead to a new position depending on the current device

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

DISPLAY :

Display or print records to the console or printer

DISPLAY <exp list>
   [TO PRINTER] [TO FILE <xcFile>]
   [<scope>] [WHILE <lCondition>]
   [FOR <lCondition>] [OFF]

EJECT :

Advance the print head to top of form

EJECT

ISPRINTER() :

Determine whether the LPT1 is ready

ISPRINTER() --> lReady

LABEL FORM :

Display or print labels to the console or printer

LABEL FORM <xcLabel>
   [TO PRINTER] [TO FILE <xcFile>] [NOCONSOLE]
   [<scope>] [WHILE <lCondition>] [FOR <lCondition>]
   [SAMPLE]

LIST :

List or print records to the console or printer

LIST <exp list>
   [TO PRINTER] [TO FILE <xcFile>]
   [<scope>] [WHILE <lCondition>]
   [FOR <lCondition>] [OFF]

OUTSTD() :

Write a list of values to the standard output device

OUTSTD(<exp list>) --> NIL

PCOL() :

Return the current column position of the printhead

PCOL() --> nColumn

PROW() :

Return the current row position of the printhead

PROW() --> nRow

QOUT() :

Display or print a list of expressions to the console or printer

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

REPORT FORM :

Display or print a report to the console or printer

REPORT FORM <xcReport>
   [TO PRINTER] [TO FILE <xcFile>] [NOCONSOLE]
   [<scope>] [WHILE <lCondition>] [FOR <lCondition>]
   [PLAIN | HEADING <cHeading>] [NOEJECT] [SUMMARY]

SET MARGIN :

Set the page offset for all printed pages

SET MARGIN TO [<nPageOffset>]

SET PRINTER :

Toggle echo of console output to the printer or set the destination of printed output

SET PRINTER on | OFF | <xlToggle>
SET PRINTER TO [<xcDevice> | <xcFile> [ADDITIVE]]

SETPRC() :

Set PROW() and PCOL() values

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

TYPE :

Display or print the contents of a text file

TYPE <xcFile> [TO PRINTER] [TO FILE <xcOutFile>]