[mod.computers.vax] SYSTARTUP.COM, Time Trap on OPA0 prompts.

CBSY8001@IRUCCIBM.BITNET ("J.F.Murphy") (08/14/86)

Re SYSTARTUP.COM asking "whaddya want" or somesuch at OPA0,
    READ/TIME_OUT works fine since VMS rel 3.?
I ran the following ancient BASIC routine in our SYSTARTUP.COM
since 1979 on VMS 1 and 2 (before the advent of READ/TIME_OUT) -
to wait for a reply to a prompt as to whether the FULL system
should be brought up and announced OR (if anybody were present
to reply) an un-announced VMS without the full bells 'n whistles.
Crummy, maybe,  but a lot less convoluted than some methods that
I've seen AND it worked!

  001 REM
  002 REM STATUS  =1 if 30-sec time trap
  003 REM STATUS <>1 if <cr>, Y or YES entered
  004 REM
  100 ON ERROR GOTO 700
  200 RET%=2                       ! Error Return Code
  300 WAIT 30%                     ! Set 30-second Time Trap
  400 LINPUT " Well ??? "; REPLY$  ! Await reply only for Specified time
  500 REPLY$=EDIT$(REPLY$,32%)     ! Convert reply to Uppercase
  600 IF REPLY$<>"" AND REPLY$<>"Y" AND REPLY$<>"YES" THEN GOTO 800
  700 CALL SYS$EXIT (RET%)
  800 END

jfm