PROCEDURE prompt_for_printer_parity (
  parity : (var) string = $optional
  status : (var) status = $optional
  )

  create_variable input_string k=string

parity_loop: ..
  LOOP
    put_line '0Enter the parity to be used with the ASYNC printer or ? for help:'
    accept_line input_string input p=''

    IF (input_string = '?') OR ($translate(lower_to_upper, input_string) = 'HELP') THEN
      put_line ('1Supply the data parity of your ASYNC printer. ' ..
            ' If your printer is a CDC 536 printer, choose ODD parity. ' ..
            ' If your printer is a CDC 537 printer, choose EVEN parity. ')
    ELSEIF input_string = ' ' THEN
      EXIT parity_loop
    ELSEIF ($translate(lower_to_upper, input_string) = 'QUIT') OR ..
          ($translate(lower_to_upper, input_string) = 'QUI') THEN
      $value(parity) = ' '
      EXIT parity_loop
    ELSE
      $value(parity) = $translate(lower_to_upper, input_string)
      IF $value(parity) = 'ODD' OR $value(parity) = 'EVEN' THEN
        EXIT parity_loop
      ELSE
        put_line '0 --ERROR--  '//$value(parity)//' is not an acceptable value for parity.' o=$response
        accept_line input_string input p='Press NEXT'
      IFEND
    IFEND
  LOOPEND parity_loop

PROCEND prompt_for_printer_parity
