Let me clarify. The program in question, is a basic program to set font type & page orientation on the printer. I did not write the program, but I spent some time messing with it and afer doing some checking, it appears that any line that starts with "??? chr(27)+...." causes the extra page. I have gone thru the whole program and REMed out each line one by one to find out what was causing the problem and thats the conclusion I came to. Here is the whole program, its fairly small. Please take a look at it and let me know if there is a different way to set these parameters. Thanks.
*************************** HPS CODE *****************************
* UDF hps, HP laserjet setup
* Based on HPFCHAR2.PRG by Menachem Bazian in foxtalk 8/90
*
function hps
parameters orient,pitch,lpi
IF SYS(101) = "SCREEN"
SET DEVICE TO print
ENDIF
SET PRINTER on
if upper(orient) = "P"
??? chr(27)+"&l0O"
else
??? chr(27)+"&l1O"
endif
xpitch=pitch
if xpitch = 16
xpitch = 17
endif
if pitch = 0
??? chr(27)+"(s1P"
else
??? chr(27)+"(s0p"
??? chr(27)+"(s"+alltrim(str(xpitch))+"H"
endif
point size
strpoint = alltrim(str(72 / lpi))
mstr=chr(27)+"(s"+strpoint+"V"
??? mstr
force upright style
??? chr(27)+"(s0S" && upright style
??? chr(27)+"(s0B"
symbol set
?? chr(27)+"("+"R8"
type face
do case
case pitch = 10
??? chr(27)+"(s"+"0034"+"T"
case pitch = 12
??? chr(27)+"(s"+"0035T"
case pitch = 16
??? chr(27)+"(s0036T"
endcase
vmi
??? chr(27)+"&l"+alltrim(str((48 / lpi ),8,4))+"C"
Suppress skip @ eop
??? chr(27)+"&l0L"
set print &old_prt_st
return (0)