shsimjee
Programmer
- May 2, 2012
- 5
shsimjee (Programmer) 18 Jul 12 3:41
i am writing to a pole display (com1) from my clipper program
when i was using windows 98 the message used to write to the
pole display. since changing to windows xp i get an error
error term/0 print error quit / retry. how do i overcome this error.
if i mode com1:96,n,8,1 then do a dir > com1
the pole display will display the directory but from my program
this error occurs
attach sample of my program
#include "Inkey.ch"
#include "TButils.ch"
#include "Setcurs.ch"
#include "CMX.CH"
Mdate := TODAY := MRDATE := DATE()
PUBLIC nT,nL,nB,nR
cBox := dBox := mBox := oBox := sBox := ' '
nT:=nL:=nB:=nR:=nqty:=namt:=ntot:=0
cDes := nTyp := ' '
Set HEADING off ; Set safety off
Set DECIMALS to 2 ; Set date British
Set FIXED on ; Set DELETE on
Set TALK off ; Set BELL off
Set INTENSITY on ; set EXCLUSIVE off
Set CENTURY on ; set EPOCH TO 1970
SET function 10 to '' ; SET EXACT OFF
**
If ISCOLOR()
cSays = "BG+/B,GR+/BG,G,,GR+/BG"
cBox = "W+/B,GR+/BG,G,,N/BG"
cGets = "W+/B,GR+/BG,G,,GR+/BG"
cAlert := "W+/R,GR+/BG,,,W+/R"
Else
cBox = "W"
cSays = "W/N, N/W"
cGets = "W/N, N/W"
cAlert := "W/N,N/W,,,W/N"
Endif
**
Fram_d = chr(201)+chr(205)+chr(187)+chr(186)+;
chr(188)+chr(205)+chr(200)+chr(186)+chr(255)
Fram_s = Chr(218)+chr(196)+chr(191)+chr(179)+;
Chr(217)+chr(196)+chr(192)+chr(179)+chr(255)
Fram_ds = chr(213)+chr(205)+chr(184)+chr(179)+;
chr(190)+chr(205)+chr(212)+chr(179)+chr(255)
Fram_sd = chr(214)+chr(196)+chr(183)+chr(186)+;
chr(189)+chr(196)+chr(211)+chr(186)+chr(255)
**
cdspport := "COM1" && Display port
cDspType := "1"
SETCOLOR(cSays)
CUS_DISP(,,,,"6")
Return
****************************************
FUNCTION Cus_Disp(cDes,nQty,nAmt,nTot,nTyp)
LOCAL nRow,nCol
nRow := PROW()
nCol := PCOL()
nDes := If(cDes==NIL,space(20),cDes)
nQty := If(nQty==NIL,space(6),IF(substr(str(nQty,6,2),5,6)=="00",str(nQty,5,0)+" ",str(nQty,6,2)))
nAmt := If(nAmt==NIL,space(6),str(nAmt,6,2))
nTot := If(nTot==NIL,space(7),str(nTot,7,2))
nTyp := If(nTyp==NIL,"1",nTyp)
SET printer to &cdspport
SET DEVICE to PRINT
SET printer on
set console off
Do Case
Case nTyp == "1"
? PADC(nDes,20," ")+nQty+nAmt+nTot
Case nTyp == "2"
? PADC("TOTAL",20," ")+PADC(nTot,19," ")
Case nTyp == "3"
? space(20)+space(21)
Case nTyp == "4"
? PADC("Amt Tendered",20," ")+PADC(nTot,19," ")
Case nTyp == "5"
? PADC(PADC(" CHANGE :"+nTot,19," ")+"Tendered :"+nAmt,20)
Case nTyp == "6"
? PADC("Please",20," ")+PADC("Next Customer",19," ")
Case nTyp == "7"
? space(20)+space(19)
Endcase
SETPRC(nRow,nCol)
set printer off
Set Printer to
set console on
SET DEVICE to SCREEN
Return .T.
i am writing to a pole display (com1) from my clipper program
when i was using windows 98 the message used to write to the
pole display. since changing to windows xp i get an error
error term/0 print error quit / retry. how do i overcome this error.
if i mode com1:96,n,8,1 then do a dir > com1
the pole display will display the directory but from my program
this error occurs
attach sample of my program
#include "Inkey.ch"
#include "TButils.ch"
#include "Setcurs.ch"
#include "CMX.CH"
Mdate := TODAY := MRDATE := DATE()
PUBLIC nT,nL,nB,nR
cBox := dBox := mBox := oBox := sBox := ' '
nT:=nL:=nB:=nR:=nqty:=namt:=ntot:=0
cDes := nTyp := ' '
Set HEADING off ; Set safety off
Set DECIMALS to 2 ; Set date British
Set FIXED on ; Set DELETE on
Set TALK off ; Set BELL off
Set INTENSITY on ; set EXCLUSIVE off
Set CENTURY on ; set EPOCH TO 1970
SET function 10 to '' ; SET EXACT OFF
**
If ISCOLOR()
cSays = "BG+/B,GR+/BG,G,,GR+/BG"
cBox = "W+/B,GR+/BG,G,,N/BG"
cGets = "W+/B,GR+/BG,G,,GR+/BG"
cAlert := "W+/R,GR+/BG,,,W+/R"
Else
cBox = "W"
cSays = "W/N, N/W"
cGets = "W/N, N/W"
cAlert := "W/N,N/W,,,W/N"
Endif
**
Fram_d = chr(201)+chr(205)+chr(187)+chr(186)+;
chr(188)+chr(205)+chr(200)+chr(186)+chr(255)
Fram_s = Chr(218)+chr(196)+chr(191)+chr(179)+;
Chr(217)+chr(196)+chr(192)+chr(179)+chr(255)
Fram_ds = chr(213)+chr(205)+chr(184)+chr(179)+;
chr(190)+chr(205)+chr(212)+chr(179)+chr(255)
Fram_sd = chr(214)+chr(196)+chr(183)+chr(186)+;
chr(189)+chr(196)+chr(211)+chr(186)+chr(255)
**
cdspport := "COM1" && Display port
cDspType := "1"
SETCOLOR(cSays)
CUS_DISP(,,,,"6")
Return
****************************************
FUNCTION Cus_Disp(cDes,nQty,nAmt,nTot,nTyp)
LOCAL nRow,nCol
nRow := PROW()
nCol := PCOL()
nDes := If(cDes==NIL,space(20),cDes)
nQty := If(nQty==NIL,space(6),IF(substr(str(nQty,6,2),5,6)=="00",str(nQty,5,0)+" ",str(nQty,6,2)))
nAmt := If(nAmt==NIL,space(6),str(nAmt,6,2))
nTot := If(nTot==NIL,space(7),str(nTot,7,2))
nTyp := If(nTyp==NIL,"1",nTyp)
SET printer to &cdspport
SET DEVICE to PRINT
SET printer on
set console off
Do Case
Case nTyp == "1"
? PADC(nDes,20," ")+nQty+nAmt+nTot
Case nTyp == "2"
? PADC("TOTAL",20," ")+PADC(nTot,19," ")
Case nTyp == "3"
? space(20)+space(21)
Case nTyp == "4"
? PADC("Amt Tendered",20," ")+PADC(nTot,19," ")
Case nTyp == "5"
? PADC(PADC(" CHANGE :"+nTot,19," ")+"Tendered :"+nAmt,20)
Case nTyp == "6"
? PADC("Please",20," ")+PADC("Next Customer",19," ")
Case nTyp == "7"
? space(20)+space(19)
Endcase
SETPRC(nRow,nCol)
set printer off
Set Printer to
set console on
SET DEVICE to SCREEN
Return .T.