SHECTMAN%SETI@ICDC.LLNL.GOV (02/10/88)
[ INHERIT('SYS$LIBRARY:STARLET.PEN'), ] PROGRAM keyin(INPUT,OUTPUT) ; CONST TERMINAL_INPUT_EVENT_FLAG = 10 ; VAR THE_CHARACTER : CHAR ; CHANNEL_NUMBER_ASSIGN : [WORD] 0..65535 ; CHANNEL_NUMBER_QIO : INTEGER ; IO_STATUS_BLOCK : RECORD WORD1 : INTEGER ; WORD2 : INTEGER ; END ; PROCEDURE INITIATE_TERMINAL_INPUT ; VAR STATUS : INTEGER ; BEGIN STATUS := $QIO(TERMINAL_INPUT_EVENT_FLAG, CHANNEL_NUMBER_QIO, IO$_READVBLK+IO$M_NOECHO+IO$M_NOFILTR+IO$M_TRMNOECHO, IO_STATUS_BLOCK, {NAME OF THE AST ROUTINE}, {AST PARAMETER}, THE_CHARACTER, 1) ; END ; FUNCTION INKEY$ : STRING ; VAR ALL_EVENT_FLAGS : UNSIGNED ; STATUS : INTEGER ; BEGIN STATUS := $READEF(TERMINAL_INPUT_EVENT_FLAG,ALL_EVENT_FLAGS) ; IF STATUS = SS$_WASCLR THEN INKEY$ := '' ELSE BEGIN INKEY$ := THE_CHARACTER ; INITIATE_TERMINAL_INPUT ; END ; END ; BEGIN $ASSIGN('SYS$INPUT:',CHANNEL_NUMBER_ASSIGN) ; CHANNEL_NUMBER_QIO := CHANNEL_NUMBER_ASSIGN ; INITIATE_TERMINAL_INPUT ; {rest of program goes here - makes calls to inkey} END.