      LOGICAL FUNCTION YESX(X,Y,Z,SPK)
C 
C  PRINT MESSAGE X, WAIT FOR YES/NO ANSWER.  IF YES, PRINT Y AND LEAVE Y
C  TRUE; IF NO, PRINT Z AND LEAVE YEA FALSE.  SPK IS EITHER RSPEAK OR MS
C 
      IMPLICIT INTEGER*4 (A-Z)
      COMMON /ALPHAS/ CYES,CY,CNO,CN
C 
 1     IF(X.NE.0)CALL SPK(X)
      CALL GETIN(REPLY,JUNK1,JUNK2,JUNK3)
      IF(REPLY.EQ.CYES.OR. REPLY.EQ.CY)GOTO 10
      IF(REPLY.EQ.CNO .OR. REPLY.EQ.CN)GOTO 20
      WRITE(*,9)
 9     FORMAT(' Please answer the question.')
      GOTO 1
 10    YESX=.TRUE.
      IF(Y.NE.0)CALL SPK(Y)
      RETURN
 20    YESX=.FALSE.
      IF(Z.NE.0)CALL SPK(Z)
      RETURN
      END
