Author | Topic: tdcprn4:newfont() | |
---|---|---|
Donald Keating | tdcprn4:newfont() on Thu, 19 Jan 2012 16:56:35 -0500 Hi Y'all, The attachederror is caused by this code. oP:newFont("15.Times New Roman Italic") Someone please tell me why. Thanks. >don< Error.txt | |
Joe Carrick | Re: tdcprn4:newfont() on Thu, 19 Jan 2012 14:41:35 -0800 Don, You really should send CJ an email on this. He's much better equipted to answer this. On 1/19/2012 1:56 PM, Donald Keating wrote: > Hi Y'all, > > The attachederror is caused by this code. > oP:newFont("15.Times New Roman Italic") > > Someone please tell me why. > > Thanks. > > >don< | |
Zupan Miran | Re: tdcprn4:newfont() on Fri, 20 Jan 2012 08:32:36 +0100 Dne 19.1.2012 22:56, piše Donald Keating: > Hi Y'all, > > The attachederror is caused by this code. > oP:newFont("15.Times New Roman Italic") oError:operation : nominalPointSize I thing you must use oP:newFont("14.Times New Roman Italic") or oP:newFont("16.Times New Roman Italic") because font size 15.Times New Roman Italic does not exist Best regards Miran Zupan Slovenia | |
Zupan Miran | Re: tdcprn4:newfont() on Fri, 20 Jan 2012 08:50:13 +0100 OK, in my previous post I assume that font 15. is not valid but then I test it with this little code (with different fonts) printing on EPSON POS and it work OK In this test code data fields are replaced with "words" FUNCTION Izpis_Rac(oBrowse) LOCAL oP LOCAL nLine,nTot,nCounter LOCAL nC1,nC2,nC3,nC4,nC5 oP:= tdcPrn4():New(cPrinter) oP:Create() //*** test for printer init ok IF oP:lInitErr oP:destroy() oDlg:lHandleKeys := .T. RETURN .F. ENDIF //*** begin output to spooler oP:StartDoc() //*** init oP:setPt(tdPT_NORM) match nPt to default font vrsta:=1 //*** GLAVA RACUNA *** oP:newFont("15.Times New Roman CE Bold Italic") oP:prCenter(vrsta,"Trgovina LIPA d.o.o.") vrsta++ oP:prCenter(vrsta,"Poslovalnica CRNOMELJ") vrsta++ oP:newFont("12.Arial CE") oP:prCenter(vrsta,"Jurckova cesta 255") vrsta++ oP:prCenter(vrsta,"1234 Zuzembek") vrsta++ oP:prCenter(vrsta,"ID Stev.: SI12345678") vrsta++ oP:prCenter(vrsta,"Tel.: 01 / 564 - 40 - 07") vrsta:=++vrsta+1 oP:newFont("15.Times New Roman CE Bold Italic") oP:prCenter(vrsta,"RACUN St.: 005840") vrsta++ oP:newFont("10.Arial CE") oP:prCenter(vrsta,dtoc(date())+" "+time()) vrsta:=++vrsta oP:prln(vrsta,1,replicate(chr(95),42)) vrsta++ oP:prln(vrsta, 1,"Naziv blaga") oP:prln(vrsta,24,"Vrednost") vrsta++ oP:prln(vrsta, 4,"Koliź. MPC Pop DDV Skupaj") oP:prln(vrsta,1,replicate(chr(95),42)) vrsta++ //*** FOR TEST ONLY *** oP:newFont("10.Arial CE") xN1:="Krema za soncenje SUNMIX 100" xN2:=1.00 kolicina xN3:=7.00 MPC xN4:=10.5 popust xN5:= 1 ddv xN6:=6.30 skupaj //test 1. vrsta oP:prln(vrsta, 1,xN1) vrsta++ oP:prln(vrsta, 4,padr(xN2,6)) oP:prln(vrsta,10,padr(xN3,8)) oP:prln(vrsta,16,padr(xN4,4)+" %") oP:prln(vrsta,21,padr(xN5,4)) oP:prln(vrsta,24,padr(xN6,4)) vrsta++ //test 2. vrsta xN1:="Casopis MOJ MIKRO" xN2:=11.00 kolicina xN3:=24.50 MPC xN4:=0 popust xN5:=1 ddv xN6:=4.50 skupaj oP:prln(vrsta, 1,xN1) vrsta++ oP:prln(vrsta, 4,padr(xN2,6)) oP:prln(vrsta,10,padr(xN3,8)) oP:prln(vrsta,16,padr(xN4,4)+" %") oP:prln(vrsta,21,padr(xN5,4)) oP:prln(vrsta,24,padr(xN6,4)) vrsta++ //*** SKUPAJ *** oP:prln(vrsta,1,replicate("=",42)) vrsta++ oP:prln(vrsta, 1,"SKUPAJ za placilo EUR") oP:newFont("11.Arial Bold") xN7:=10.80 //za placilo oP:prln(vrsta,22,transform(xN7,"9,999.99")) vrsta++ //*** RAZGRADNJA DDV *** oP:newFont("10.Arial") oP:prln(vrsta,5,replicate("-",46)) vrsta++ oP:prln(vrsta,5,"Stopnja Osnova DDV Skupaj") vrsta++ oP:prln(vrsta,5,replicate("-",46)) vrsta++ yN1:=1 stopnja yN2:=20.0 procent yN3:=110.5 osnova yN4:= 20.55 ddv yN5:=130.60 skupaj oP:prln(vrsta, 5,padr(yN1,2)) oP:prln(vrsta, 7,"-"+padr(yN2,4)) oP:prln(vrsta,12,padr(yN3,5)) oP:prln(vrsta,16,padr(yN4,5)) oP:prln(vrsta,19,padr(yN5,5)) vrsta++ vrsta++ oP:newFont("11.Arial CE") oP:prCenter(vrsta,"* ZAHVALJUJEMO SE VAM ZA NAKUP *") vrsta++ oP:prCenter(vrsta,"DELOVNI CAS:") vrsta++ oP:prCenter(vrsta,"Vsak dan od 8.30 - 21.00") vrsta++ oP:prln(vrsta,10,replicate(" ",10)) //*** pocisti ta sabo *** oP:EndDoc() end output to spooler oP:Destroy() destroy Pr object setAppFocus(oBrowse) RETURN nil Best regards Miran Zupan | |
Raymond Fischbach | Re: tdcprn4:newfont() on Fri, 20 Jan 2012 20:30:03 +0100 Dans son message précédent, Donald Keating a écrit : > Hi Y'all, > > The attachederror is caused by this code. > oP:newFont("15.Times New Roman Italic") > > Someone please tell me why. > > Thanks. > > >don< Hello Don, It seems to me that the error means that your oP doesn't exist (not created or destroyed). Message: Receiver of message is not an object HTH, Raymond | |
Donald Keating | Re: tdcprn4:newfont() on Sat, 21 Jan 2012 20:05:00 -0500 Thanks Joe, Zupan and Raymond for your responses! I actually had two errors being reported by tdcprn4() and tdprv4() when called from one of my PRGs. I choose to post only one here hoping someone would give me an idea what was happening. I was not doubting Topdown; Clayton has had it virtually bullet proof for several years. Nothing I tried with my code fixed the problem. So, I restored the last version of the PRG that worked; not exactly as I wanted but produced no errors. Changed the PRG small pieces at a time checking was I went. I'm pleased to report I now have it working as desired. Peace. >don< On Thu, 19 Jan 2012 16:56:35 -0500, Donald Keating wrote: > Hi Y'all, > > The attachederror is caused by this code. > oP:newFont("15.Times New Roman Italic") > > Someone please tell me why. > > Thanks. > > >don< |