EJECT Command 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