IDENTIFICATION DIVISION. PROGRAM-ID. LOCK_TERMINAL. AUTHOR. Ken Richardson. INSTALLATION. COMPASSION, INT'L. DATE-WRITTEN. June 17, 1987. DATE-COMPILED. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. VAX-11. OBJECT-COMPUTER. VAX-11. DATA DIVISION. WORKING-STORAGE SECTION. 01 constants. 02 control-y-mask pic s9(9) comp value external lib$m-cli-ctrly. 02 ws-false pic x value "F". 02 ws-true pic x value "T". 01 variables. 02 ctrlc-entered-flag pic x. 02 dispatch pic 9(9) comp. 02 exit-sw pic x. 02 lock-password pic x(80). 02 verification-password pic x(80). PROCEDURE DIVISION. Lock-terminal-main. move ws-false to exit-sw perform varying dispatch from 1 by 1 until exit-sw = ws-true evaluate dispatch when 1 perform get-password when 2 perform check-password when 3 perform get-verification-password when 4 perform check-verification-password when 5 perform disable-escape-from-program perform test-for-valid-exit until exit-sw = ws-true perform enable-escape-from-program when other display "Internal dispatch error." move ws-true to exit-sw end-evaluate end-perform stop run . disable-escape-from-program. call "lib$disable-ctrl" using by reference control-y-mask call "ci$enable_ctrlc_ast" using by reference ctrlc-entered-flag . get-password. display "Enter lock password: " with no advancing accept lock-password no echo at end move ws-true to exit-sw end-accept . check-password. if lock-password = spaces then display "Blank password entered." move ws-true to exit-sw end-if . get-verification-password. display "Verify lock password: " with no advancing accept verification-password no echo at end move ws-true to exit-sw end-accept . check-verification-password. if verification-password = lock-password then move spaces to verification-password else display "Password mismatch." move ws-true to exit-sw end-if . test-for-valid-exit. display "Enter unlock password: " with no advancing accept verification-password no echo at end display "End-of-file detected." end-accept if verification-password = lock-password then move ws-true to exit-sw else display "Invalid unlock password." end-if . enable-escape-from-program. call "lib$enable-ctrl" using by reference control-y-mask .