Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EJECT not working

Status
Not open for further replies.

SitesMasstec

Programmer
Sep 26, 2010
521
Brasil
Hello colleagues!

I am trying to print 200 values of X (X=1, X=2, X=3, ... X=200), each value of X in one line, this way:
valorX_fcyw9r.jpg

Problem is: it should print 3 pages, but the result was only 1 page, with the X=70 print.
The program is:

Code:
ImpressOpcao = ""
ImpressOpcao = GETPRINTER( ) && Displays the Windows Printer Dialog
IF(EMPTY(ImpressOpcao))
        RETURN
ENDIF
SET PRINTER TO NAME (ImpressOpcao)

SET CONSOLE OFF
SET DEVICE TO PRINTER
SET COLOR TO RGB(0,0,0,  0,0,0), RGB(255,255,255,  255,255,255)

LINHA=0

ON PAGE AT LINE 68 DO EJETAR

FOR X = 1 TO 200
	LINHA=LINHA+1
	@LINHA, 5 SAY "X = " + STR(X, 3)
ENDFOR

SET PRINTER OFF
SET PRINTER TO DEFAULT
ON PAGE
SET CONSOLE ON
SET DEVICE TO SCREEN


PROCEDURE EJETAR
@60, 1 SAY "This is the end of the page"
EJECT PAGE
RETURN

Thank you.


Thank you,
SitesMasstec
 
Have you checked the setting of [tt]_PADVANCE[/tt]? Also, are you sure you can physically print 68 lines on the page (68 being the value that triggers [tt]ON PAGE[/tt])?

More important question: Do you really need to do the job in this way? I would have thought it was simpler and more reliable to use [tt]? "X = " + STR(X, 3)[/tt] inside your loop, and to issue [tt]EJECT[/tt] (not [tt]PAGEEJECT[/tt]) when x = 68 or 136.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Looking into the help topic about EJECT PAGE, you see what Mike pointed out and a bit more. There are other system variables, _PLENGTH for example, that would be importatn to define the page length.
And there is ON PAGE.

Also don't expect this to do a paper cut. If you want to print text, the usual way is to use Generic/Text Only as the basis and ???.



Chriss
 
Hello colleagues!

I haven't checked _PADVANCE, _PLENGTH or ONPAGE (I used ON PAGE AT LINE 68 DO ... above) yet.

Mike, I undestand your suggestion. Indeed I used it, but my program is much bigger than the one example I published above (X=1... X=200). I have to put lots of test to eject page.

Thank you.


Thank you,
SitesMasstec
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top