📄 error.f
字号:
$alias fdopen='fdopen'(%val,%ref) include 'phigs.f1.h' ! get the HP-PHIGS aliases program Error ! program "Error.f" include 'phigs.f2.h' ! get the HP-PHIGS constants integer*4 WorkstnID ! workstation identifier parameter (WorkstnID=1) ! value chosen by the user integer*4 ConnID ! connection identifier integer*4 WorkstnType ! workstation type parameter (WorkstnType=POIDDX) ! outin, direct, dbl bfr, X integer*4 ErrorRtn ! error-return variable integer*4 OldHandler ! storage for addresses external MyErrorHandler ! forward reference integer*4 fdopen ! to get file descriptor call popph(fdopen(fnum(7), 'w'//char(0)), 0) ! open phigs call pue004('/dev/screen/phigs_window', ConnID) ! get connection ID call popwk(WorkstnID, ConnID, WorkstnType)! open workstation !--- make an error with the standard error-handler in effect ----------- print *, "--- Default error-handler in effect ------------------" call pswkw(WorkstnID, 0.0, 0.0, 0.0, 0.0) ! set workstation window !--- turn off error handling completely -------------------------------- print *, "--- No error-handler in effect -----------------------" call pserhm(POFF) ! set error-handling mode: off call pswkw(WorkstnID, 0.0, 0.0, 0.0, 0.0) ! set workstation window !--- install custom error-handler and make error again ----------------- print *, "--- Custom error-handler in effect -------------------" call pserhm(PON) ! set error-handling mode: on call pue700(MyErrorHandler, ErrorRtn, OldHandler) ! replace error handler if (ErrorRtn .ne. 0) then print *, "Error", ErrorRtn, "from pue700; terminating." stop end if call pswkw(WorkstnID, 0.0, 0.0, 0.0, 0.0) ! set workstation window call pclwk(WorkstnID) ! close workstation call pclph ! close phigs stop ! stop processing end ! end of program!***********************************************************************+***** subroutine MyErrorHandler(ErrorNo, FuncID, ErrorFile) integer*4 ErrorNo ! which error happened? integer*4 FuncID ! which routine had the error? integer*4 ErrorFile ! print error messages where? print *,"MyErrorHandler: Error", ErrorNo, " occurred in ", + "routine", FuncID print *,"My own call to the ERROR LOGGING routine (perlog):" call perlog(ErrorNo, FuncID, ErrorFile) return end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -