EJECT Command

Sends a formfeed to the printer.

EJECT

Remarks

EJECT advances the printer to the top of the next page. EJECT sends a formfeed to the printer if the _PADVANCE system memory variable is set to FORMFEED. If _PADVANCE is set to LINEFEEDS, EJECT issues linefeeds to advance to the top of the next page.

EJECT resets PCOL( ) and PROW( ) values to the current column and row position of the printer's print head, but doesn't affect the value of the _PAGENO or _PLINENO system variables.

Example

In the following example, the company and phone fields in the customer table are printed. (Make sure a printer is attached and turned on for this example.) When the number of rows printed is greater than 62, the page is ejected.

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'data\testdata')
USE customer  && Opens customer table

SET DEVICE TO PRINTER
SET PRINT ON
DO WHILE NOT EOF( )
   @ PROW( )+1,10 SAY 'Company: ' + company
   @ PROW( )+1,10 SAY 'Phone: ' + phone
   @ PROW( )+1,1  SAY ''
   IF PROW( ) > 62
      EJECT
   ENDIF
   SKIP
ENDDO
SET PRINT OFF
SET DEVICE TO SCREEN

See Also

Reference

EJECT PAGE Command
ON PAGE Command
SET DEVICE Command
SET PRINTER Command
PCOL( ) Function
PROW( ) Function
System Variables Overview

Other Resources

Commands (Visual FoxPro)