You do not change ports net use redirects ports. That is why I release lpt1: at end of bat file. net use lpt1: /delete
I use this in HB30 and Clipper NOT HMG.
In hmg I use normal print set.
Here is a crude example
Code: Select all
Procedure Printsmall
*------------------------------------------------------------------------------*
Local i ,lSuccess, pl:= 0, Page := 1, PR := 'Star' //ALLTRIM(Controls->prn1)
Parameter DI
select your print file
go top
SELECT PRINTER PR TO LSUCCESS ; //PREVIEW ;
ORIENTATION PRINTER_ORIENT_PORTRAIT ;
QUALITY PRINTER_RES_MEDIUM
If lSuccess <> .T.
MsgInfo('Print Not Available')
return
EndIf
pl:=pl+5
START PRINTPAGE
pl:=pl+5
@ pl,5 print 'Company' FONT "Arial" SIZE 8
@ pl+4,5 Print 'Address. SIZE 8
pl:=pl+18
@ pl+4,5 Print 'Sold To: customer->name 'FONT "Arial" SIZE 7
@ pl+8,5 print ' Address.' 'FONT "Arial" SIZE 7
pl:=pl+12
@ pl+4,2 print 'Item Description '+;
' Amount' FONT "Arial" SIZE 7
@ pl+8,1 Print Line TO pl+8,80 penwidth 0.1 //110
pl:=pl+6 //8
go top
do while ! eof()
if eof()
exit
endif
@ pl+4,1 print 'item' FONT "Arial" SIZE 6 bold //10
@ pl+4,22 print 'desc' FONT "Arial" SIZE 6 BOLD //45
@ pl+4,70 print ' 129.00' right FONT "Arial" SIZE 7 //110
pl:=pl+4
if pl >= controls->invlines*4 // a value in my control file is 55
END PRINTPAGE
START PRINTPAGE // this stops eject
PL := -4
endif
skip
loop
enddo
** next print footertotals no not forget to keep adding 4 for every line
END PRINTPAGE
END PRINTDOC
return
I have three print outs for invoices PRINTBIG, PRINTLITTLE, PRINTFILE.
Franco