home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Du Jour
/
SoftwareDuJour.iso
/
BUSINESS
/
DBASE
/
MEMBERS.ARC
/
ERRCHK.PRG
< prev
next >
Wrap
Text File
|
1986-10-16
|
2KB
|
72 lines
*----------------------------------------------------------------------
* Program : Membership Database Package
* File : ERRCHK
* Function: Error Interception & Recovery
* Author : J. North
* Version : (AT contest)
* Date : 10/15/86
*----------------------------------------------------------------------
*
private code,err_msg
err_msg=message()
code=error()
do case
case code=125.or.code=126
set print off
set console on
set escape off
on escape
clear
do dialog with 10,"Printer Not Ready -- Press any key"
wait ""
use
return to master
case code=114
?? chr(7)
set console off
reindex
set console on
retry
endcase
on error
set device to screen
set print off
set console on
do clwait
call curson
? "An error has occured! Recording Information ..."
set console off
* ---Setup alternate file name.
set date ansi
err_file=right(dtoc(date()),5)+"-"+right(time(),2)+".ERR"
err_file=stuff(err_file,3,1,"-")
* ---Set and turn on Error File.
set alternate to &err_file
set alternate on
* -- Record Vital Statistics
? "-------------------------------------------------------------------"
? "Date: "+dtoc(date())
? "Time: "+time()
? "-------------------------------------------------------------------"
? "Error: "+err_msg
? "-------------------------------------------------------------------"
? "Database In Use : "+dbf()
? "Open Index Files --"
i=1
do while i<8
? " "+ndx(i)
i=i+1
enddo
? "Remaining Disk Space: ",diskspace()
? "-------------------------------------------------------------------"
? "Memory --"
list memory
* ---Reset alternate file.
set alternate off
set alternate to
close databases
set console on
wait "Error recorded in "+err_file+". Press any key"
quit