$TITLE:'  EXAMPLE OF USING POLKBD'
      INTEGER*2 STAT
      CHARACTER*1 CHR
C
C   PROGRAM CONTINUES IN AN INFINITE LOOP UNTIL
C   THE 'C' KEY IS PRESSED.
C
      I=0
10    I=I+1
      CALL POLKBD(STAT)
      IF(STAT.EQ.0) GO TO 10
      CALL INKEY(CHR)
      IF(CHR.EQ.'C') THEN
        WRITE(0,*)' I=',I
        WRITE(0,'(A\)')' DO YOU WANT TO QUIT (Y/N): '
        CALL GETCHR(CHR)
        WRITE(0,*) CHR
        IF((CHR.EQ.'Y').OR.(CHR.EQ.'y')) STOP
        I=0
        GO TO 10
      ELSE
        GO TO 10
      ENDIF
      END
     