xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

EJECT

Ejects the current page from the printer.

Syntax

EJECT

Description

The EJECT command ejects the current page from the printer by sending a form feed control character (Chr(12)) to the printer. In addition, the functions for maintaining the current postion of the printhead are reset to zero (see PCol() and PRow()).

If a printer row is addressed with @...SAY that is smaller than the current printhead row, EJECT is automatically executed. To suppress this automatic formfeed, use SetPrc() to reset the internal printer row and column counters.

Info

See also:DevPos(), IsPrinter(), PCol(), PRow(), SET CONSOLE, SET DEVICE, SET PRINTER, SetPrc()
Category: Console commands , Printer commands
Source:rtl\console.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The exampledemonstrates a simple printing routine that lists
// data from a customer database

   PROCEDURE Main
      LOCAL nLines := 50
      LOCAL nPages := 1

      USE Customer NEW
      SET PRINTER ON
      SET PRINTER TO LPT1

      DO WHILE ! Eof()
         ? "Page: "+Str(nPages,8)
         ? "Date: "+DtoC(Date())

         DO WHILE .NOT. Eof() .AND. PRow() <= nLines
            ? LastName, FirstName, Phone
            SKIP
         ENDDO

         nPages ++
         EJECT            // this resets PRow()
      ENDDO

      SET PRINTER OFF

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe