PROCEDURE prompt_for_forward_search (
  forward_search_range : (var) string = $required
  status)

  VAR
    input_string: string
    conversion_status: status
    integer_number: integer
  VAREND

forward_search_loop: ..
  LOOP

    put_line (..
      '0Enter a number in the range 1-16, GO, QUIT, or ? for help.')
    accept_line input_string input p=''
    IF (input_string = '?') OR ($translate(lower_to_upper, input_string) = 'HELP') THEN
        put_line (..
          '0Specify the TCP/IP host forward search range upper value.  The default forward '..
          ' search range is 4. '..
          ' Enter GO or press NEXT to the retain the current forward search range of '//forward_search_range//'.' ..
          '0Enter QUIT to return to the Define TCP/IP Host menu with the default forward ' ..
          ' search range. ' ..
          '  ')
    ELSEIF ($translate(lower_to_upper, input_string) = 'QUIT') OR ($translate(lower_to_upper, input_string) = 'QUI') THEN
      forward_search_range = '4(10)'
      EXIT_PROC
    ELSEIF (input_string = ' ') OR ($translate(lower_to_upper, input_string) = 'GO') THEN
      EXIT_PROC
    ELSE
      include_line 'integer_number=$integer(''0''//input_string)' status=conversion_status
      IF conversion_status.normal THEN
        IF (integer_number >= 1) AND (integer_number <= 16) THEN
          forward_search_range = $strrep(integer_number) // '(10)'
          EXIT_PROC
        ELSE
          accept_line input_string input p=' TCP/IP host forward search is out of range, please correct.  Press NEXT: '
        IFEND
      ELSE
        display_value conversion_status
        accept_line input_string input p=' Invalid forward search value, please correct.  Press NEXT: '
      IFEND
    IFEND
  LOOPEND forward_search_loop

PROCEND prompt_for_forward_search
