home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1996 May
/
PCW596.iso
/
wtest
/
clico
/
sunsoft
/
pcnfs51
/
telnet.zoo
/
errmsg.ecf
< prev
next >
Wrap
Text File
|
1994-08-27
|
2KB
|
96 lines
set nover
!-------------------------------------------------------------------------------
! Command File Process for Error Messages and Codes
!-------------------------------------------------------------------------------
errcode=0
errlev=0
display
display " ERROR"
display " LEVEL $STATUS L $STATUSID Error Message"
display
loop:
on warning then goto exit
! * Shift left 3 *
errcode=(((errlev * 2) * 2) * 2)
! * Set to not print NOMSG error but still EXIT on error *
set nomess
errmsg=f$message(errcode)
set mess
! * make code fatal
errcode=errcode+4
! * Special check for fatal error without Ident *
if errcode .eq. 12 then goto abort
st=f$loc("-",errmsg)+3
sc=f$loc(",",errmsg)+2
id=f$ext(st,f$loc(",",errmsg)-st,errmsg)
! * Check for fatal system errors *
if id .eqs. "DISKFULL" then goto syserr
if id .eqs. "DIVBYZERO" then goto syserr
if id .eqs. "DOSERR" then goto syserr
if id .eqs. "FORMOPEN" then goto syserr
if id .eqs. "FORMREAD" then goto syserr
if id .eqs. "INSFMEM" then goto syserr
if id .eqs. "MEMFULL" then goto syserr
if id .eqs. "PROGERR" then goto syserr
! * Special check for nolabel error *
if id .eqs. "NOLABEL" then goto syserr
! * Call to display error messages and codes *
set noon
@errex "''id'"
errcode_out=$status .and. %h7fff
set on
! * Process to construct error message *
errmsg=f$message(id)
errmsg=f$ext(0,f$loc("<cr><lf>",errmsg),errmsg)
sevid=f$ext(st-2,f$loc(",",errmsg)-st+2,errmsg)
sevid=f$ext(0,1,sevid) + " " + f$ext(2,255,sevid)
next:
msg2=f$ext(sc,f$len(errmsg)-sc,errmsg)
space1="<HT>"
msg1=" ''errlev' ''errcode_out' ''sevid'"
if f$length(sevid) .le. 7 then space1="<HT><HT>"
display msg1+space1+msg2
set abort
errlev=errlev + 1
goto loop
! * Process to handle abort error *
abort:
sc=0
sevid="F ABORT"
goto syserr1
! * Process to handle fatal system errors *
syserr:
sevid=f$ext(st-2,f$loc(",",errmsg)-st+2,errmsg)
sevid="F " + f$ext(2,255,sevid)
! * If NOLABEL, severity = E *
if id .nes. "NOLABEL" then goto syserr1
errcode=errcode-2
sevid="E" + f$ext(1,255,sevid)
syserr1:
set noabort
errmsg=f$message(errcode)
errcode_out=errcode
goto next
exit:
set mess
exit