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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unrecoverable error need help!!!!!

Status
Not open for further replies.

gerona29

Programmer
Oct 10, 2001
10
0
0
PH
im creating a payroll application for my brother until i encounter this error which is my first ever unknown error in my 2 yrs of clipper programming i need help badly i only have 3 days more to try and solve this problem its part of my printing modules i dont seems to know what happen to it
:(
 
Perhaps you can give more information about the line where the error occurs and a bit of sourcecode?

Rob
 
sorry but i do not have it right now im just using internet cafes when i surf if you wont mind giving me your email ill email it to you maybe tommorow
anyway thanks for ging time
 
Just post it here because you will get more response!

Rob.
 
heres now the part of the source code you may want to see
#DEFINE COND_ON SendCodes(Chr(15))
#DEFINE COND_OFF SendCodes(Chr(18))



/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
Function EmpHis
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */


Local prevhandler
Local sysTitle, rptTitle, rptCond, rpt,Id, colhead, colhead2
Local pageLen, pageWidth, Tmargin, Bmargin, Lmargin, Rmargin
Local PageNo := 0

Select 1
Use MASTER
If !File("Mastrntx.ntx")
Inde on EmpNo to Mastrntx
Else
Set Inde to Mastrntx
Reindex
Endif

Select 2
Use Trans
If !File("TRANSNTX.NTX")
Inde on TEmpNo to TRANSNTX
Else
Set Inde to TRANSNTX
Reindex
Endif


goto top
HisFlag := .T.
Do While HisFlag


Set Colo to
@ 02,00 clea to 24,79

SysTitle := "PLEBEIAN Academy - Account History"
rptTitle := "Employee History"
rptCond := "(All Employee History)"
rptId := "EmpHis"
colhead2 := "------------------------------------------------------------------------"
colhead := "Salary Date Gross Pay Deduction Net Pay"
colhead3 := "------------------------------------------------------------------------"

pageLen := 65
pageWidth:= 80
Tmargin := 03 //04
Bmargin := 03
Lmargin := 05 //08
Rmargin := 05 //02

GTG := GTD := GTN := 0

PrevHandler := errorBlock()
errorBlock( { |error| PrnErr(10, 05, error, prevhandler) } )

xEmpno := 0

Set Relation to TempNo into MASTER
Save Screen to Temp
Set Colo to

Set Curs On
Set Colo to
@ 02,00 clear to 25,80
Set colo to "b+"
nRow := 03
@ 02,01 say "Ú¿"
Do While nRow <> 24
Set colo to &quot;b+&quot;
@nRow,01 say &quot;ÃÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ´&quot;
nRow++
Enddo
@ 24,01 say &quot;ÀÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÙ&quot;
set Colo to &quot;GR+/b&quot;
@ 03, 05 clear to 05,45
@ 03, 05 to 05,45 doub
set Colo to
@ 04,07 say &quot;Enter Employee Number:&quot; colo &quot;gr+/b&quot;
@ 04,30 Get xEmpno Pict &quot;@r 9999-9999&quot; colo &quot;bg+/b&quot;
Read
Set Curs Off

If !PrintReady(10,05)
Return nil
Endif

Loca for xEmpno = TempNo
If !Found()
TxtBox(&quot;Sorry No Such Employee Number Exist...&quot;,12)
return
Else
Set Filter to xEmpno
sort on Tdate
Endif

Ngalan := Alltrim(Master -> EmpLname)+&quot;, &quot;+Alltrim(Master ->EmpFname)
Numero := xEmpNo

set device to Printer
setprc(00,00)

Sele 2
Set colo to

Begin Sequence
* Do While !Master-> (eof())
Do While !Trans -> (eof())
If CheckAbort(10,05)
Break
Endif
If PageEject(pageLen, Tmargin, Bmargin)
PageNo++
PageHead(sysTitle, rptTitle, rptId, pageWidth, Lmargin, Rmargin, PageNo)
NextRow(02, Lmargin, ColHead2 )
NextRow(01, Lmargin, colhead )
NextRow(01, Lmargin, colhead3 )
Endif
NextRow(01, Lmargin, Dtoc(TDate))
SameRow(20, TGpay, &quot;999,999,999.99&quot;)
SameRow(38, Tded, &quot;999,999,999.99&quot;)
SameRow(59, TNpay, &quot;999,999,999.99&quot;)
GTG := GTG + Tgpay
GTD := GTD + TDed
GTN := GTN + TNpay
Master -> (DbSkip())
Enddo

COND_ON

NextRow(02,Lmargin+13,GTG,&quot;9,999,999,999.99&quot;)
SameRow(36,GTD,&quot;9,999,999,999.99&quot;)
SameRow(57,GTN,&quot;9,999,999,999.99&quot;)

NextRow(01, Lmargin,&quot;History of..&quot;)
NextRow(01, Lmargin, Numero,&quot;9999-9999&quot;)
NextRow(01, Lmargin, Ngalan)

COND_OFF
eject
End Sequence

errorblock(prevhandler)
set device to screen
@ 02,00 clea to 24,79
Close databases
HisFlag := .F.

Enddo
return nil


/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
Function EmpList
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */


Local prevhandler
Local sysTitle, rptTitle, rptCond, rpt,Id, colhead, colhead2
Local pageLen, pageWidth, Tmargin, Bmargin, Lmargin, Rmargin
Local PageNo := 0


If !PrintReady(10,05)
Return nil
Endif

SysTitle := &quot;PLEBEIAN Academy&quot;
rptTitle := &quot;Company Employee List&quot;
rptCond := &quot;(All Employee History)&quot;
rptId := &quot;EmpList&quot;
colhead2 := &quot;------------------------------------------------------------------------&quot;
colhead := &quot;Employee Number Employee Name Basic Salary Phone #&quot;
colhead3 := &quot;------------------------------------------------------------------------&quot;

pageLen := 65
pageWidth:= 80
Tmargin := 03 //04
Bmargin := 03
Lmargin := 05 //08
Rmargin := 05 //02

PrevHandler := errorBlock()
errorBlock( { |error| PrnErr(10, 05, error, prevhandler) } )

Select 1
Use MASTER
If !File(&quot;Mastrntx.ntx&quot;)
Inde on EmpNo to Mastrntx
Else
Set Inde to Mastrntx
Reindex
Endif

@ 02,00 clea to 24,79
Goto Top
Set Devi to Printer
setprc(00,80)

Begin Sequence
Do While !Master-> (eof())
If CheckAbort(10,05)
Break
Endif
If PageEject(pageLen, Tmargin, Bmargin)
PageNo++
PageHead(sysTitle, rptTitle, rptId, pageWidth, Lmargin, Rmargin, PageNo)
NextRow(02, Lmargin, ColHead2 )
NextRow(01, Lmargin, colhead )
NextRow(01, Lmargin, colhead3 )
Endif
NextRow(01, Lmargin, EmpNo)
SameRow(20, EmpName)
SameRow(38, EmpBSalary)
SameRow(59, EmpPhone)
master -> (DBskip())
Enddo

COND_ON
NextRow(01, Lmargin,&quot;End Of Employee List Report...&quot;)
COND_OFF
eject
End Sequence

errorblock(prevhandler)
set device to screen
@ 02,00 clea to 24,79
Close databases
HisFlag := .F.

return nil


/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
Function CheckAbort(r, c)
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */

Local abort := .F.

If Inkey() <> 0
set device to screen
Set Colo to
@ 02,00 clear to 25,80
Set colo to &quot;b+&quot;
nRow := 03
@ 02,01 say &quot;Ú¿&quot;
Do While nRow <> 24
Set colo to &quot;b+&quot;
@nRow,01 say &quot;ÃÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ´&quot;
nRow++
Enddo
@ 24,01 say &quot;ÀÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÙ&quot;
Set Colo to

Set Colo to &quot;gr+/b&quot;
@ r-1, c-1 Clear to r+3, 57
@ r-1, c-1 to r+3, 57 Doub
@ r, c say &quot;Printing Interrupted, Paused....&quot;
@ r+1, c say &quot;Do you want to abort Printing? [ Y/N ]&quot;
Abort := (chr(inkey(0)) $ &quot;Yy&quot;)
@ 02,00 clea to 24,79
If !Abort
Set Device to Printer
Endif
Endif
Return Abort


/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
Function PrintReady(r, c)
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */

Local ready := .F.
Set Device to Screen
Set Colo to
@ 02,00 clear to 25,80
Set colo to &quot;b+&quot;
nRow := 03
@ 02,01 say &quot;Ú¿&quot;

Do While nRow <> 24
Set colo to &quot;b+&quot;
@nRow,01 say &quot;ÃÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ´&quot;
nRow++
Enddo
@ 24,01 say &quot;ÀÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÙ&quot;
Set Colo to

Set Colo to &quot;gr+/b&quot;
@ r-1, c-1 Clear to r+3, 57
@ r-1, c-1 to r+3, 57 Doub
If !IsPrinter()
@ r, c say &quot;Printer isn't responding!&quot;
@ r+1, c say &quot;Check that the printer is turned on and is online&quot;
@ r+2, c say &quot;Press any key to abandon report...&quot;
Endif
Do While !(isprinter() .or. Inkey() <> 0)
Enddo
@ 02,00 clea to 24,79
If IsPrinter()
Set Devi to scree
Set Colo to
@ 02,00 clear to 25,80
Set colo to &quot;b+&quot;
nRow := 03
@ 02,01 say &quot;Ú¿&quot;
Do While nRow <> 24
Set colo to &quot;b+&quot;
@nRow,01 say &quot;ÃÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ´&quot;
nRow++
Enddo
@ 24,01 say &quot;ÀÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÙ&quot;
Set Colo to

Set Colo to &quot;gr+/b&quot;
@ r-1, c-1 Clear to r+4, 52
@ r-1, c-1 to r+4, 52 Doub
@ r, c say &quot;Ready to Print.....&quot;
@ r+1, c say &quot;Do you want to PRINT the reports now?&quot;
@ r+2, c say &quot;Press 'Y' to PRINT or any key to abandon it..&quot;
Ready := (chr(inkey(0)) $ &quot;Yy&quot;)
@ 02,00 clea to 24,79
Endif
Return Ready


/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
Function NextRow(howmany, leftmar, what, xPict)
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */

If what == nil
what := &quot; &quot;
Endif
If xpict == nil
@ prow()+ howmany, Leftmar say what
Else
@ prow()+ howmany, Leftmar say what Picture(xPict)
Endif

Return nil

/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
Function SameRow(colsover, what, xpict)
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */

If what == nil
what := &quot; &quot;
Endif
If xpict == nil
@ Prow(), colsover say what
Else
@ Prow(), colsover say what picture(xPict)
Endif
Return nil



/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
Function PageHead(sys, rpt, id, width, xleft, xright, page)
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */

Local a := dtoc(Date())+&quot; &quot;+id
Local b := time()+&quot; Page : &quot;+ltrim(str(page))

@ prow()+1, xLeft say sys
@ prow(), 60 say a //(width-Len(b)+xright)
@ prow()+1, xLeft say rpt
@ prow(), 60 say b //(width-Len(b)+xright)
Return nil



/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
Function PageEject(length, taas, baba)
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */

Local needEject := ((Prow() + baba) > length) .or. (Prow() == 0)
If needEject
If Prow() > 0
Eject
SetPrc(00,00)
Endif
@ Prow()+taas, 00 say &quot; &quot;
Endif
Return needEject


/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
Function SendCodes(string)
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */

Local r := prow(), c := pcol()
@ r,c say string
setprc(r,c)
Return &quot; &quot;


/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
Function PrnErr(r, c, err, PassAlong)
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */


Local TryPa



If Err:GenCode == EG_PRINT

Set Devi to scree
Set Colo to
@ 02,00 clear to 25,80
Set colo to &quot;b+&quot;
nRow := 03
@ 02,01 say &quot;Ú¿&quot;
@ 24,01 say &quot;ÀÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÙ&quot;
Do While nRow <> 24
Set colo to &quot;b+&quot;
@nRow,01 say &quot;ÃÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ´&quot;
nRow++
Enddo
Set Colo to

Set Colo to &quot;gr+/b&quot;
@ r-1, c-1 Clear to r+4, 60
@ r-1, c-1 to r+4, 60 Doub
@ r,c say &quot;Printer Error!&quot;
@ r+1,c say &quot;Possible Problems: Out of Paper, Jammed, Off-Line&quot;
@ r+2,c say &quot;Attempt to fix problem, Press any key to Continue&quot;
KeyBoard &quot;&quot;
Do While !(IsPrinter() .or. inkey() > 0)
Enddo
@ 02,00 clea to 24,79
If IsPrinter()
Set Devi to scree
Set Colo to
@ 02,00 clear to 25,80
Set colo to &quot;b+&quot;
nRow := 03
@ 02,01 say &quot;Ú¿&quot;
Do While nRow <> 24
Set colo to &quot;b+&quot;
@nRow,01 say &quot;ÃÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ´&quot;
nRow++
Enddo
@ 24,01 say &quot;ÀÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÙ&quot;
Set Colo to

Set Colo to &quot;gr+/b&quot;
@ r-1, c-1 Clear to r+4, 60
@ r-1, c-1 to r+4, 60 Doub
@ r,c say &quot;Printer is back...&quot;
@ r+1,c say &quot;Do you want to resume printing the report(s)?&quot;
@ r+2,c say &quot;Press 'Y' to continue or any key to cancel&quot;
Keyboard &quot; &quot;
tryPa := (Chr(Inkey(0)) $ &quot;Yy&quot;)
@ 02,00 clea to 24,79
If TryPa
set device to Printer //screen
return .T.
Endif
Endif
Break
Else
return eval(PassAlong, err)
Endif
Return nil
 
I've encountered NO ERRORS while compiling this source.
I compiled with clipper 5.2e

Rob.
 
tnx for the help, anyway .
im using clipper 5.3 do you think there is a problem with clipper application? can it may be from my computer or my printer but still i made some changes and its now up and running again thanks for the time you extended rob

gerona29
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top