PROCEDURE (hidden) rap$get_initial_option (
  installation_parameters, ip: (VAR) ..
*copy rat$installation_parameters
                                  = $required
  first_menu, fm : key install_tape_menu, initiation_menu keyend = $required
  status)


*IF $variable(rav$proc_doc,declared)<>'UNKNOWN'

" PURPOSE:
"   This procedure prompts the operator to determine if they wish to
"   install the installation tape or to activate the system for console usage
"   only (presumably for the purpose of doing a reload).
"   System initiation parameters are set based on the response.
*IFEND

  "$FORMAT=OFF
  VAR
    local_status: status
    selection: string = ''
    skip_first_menu : boolean = false
    menu_selection: string 0 .. $max_name
    menu_selection_chosen: boolean = FALSE
  VAREND
  "$FORMAT=ON"

  local_status.normal = true
  IF first_menu=initiation_menu THEN
    skip_first_menu = false
  ELSE
    skip_first_menu = true
  IFEND

get_input: ..
  WHILE NOT menu_selection_chosen DO

    menu_selection_chosen = true
    IF skip_first_menu THEN
      selection='INSTALL_INSTALLATION_TAPE'
      skip_first_menu = false
    ELSE
      rap$prompt_via_menu menu_module=initiation_menu menu_selections=(install_installation_tape, ..
            console_usage_only) prompting_options=clear_screen selection_chosen=selection status=local_status
    IFEND

    IF local_status.normal THEN

      IF selection = 'INSTALL_INSTALLATION_TAPE' THEN
        installation_parameters.installation_option = 'INSTALLATION_TAPE'
        rap$get_install_tape_values ip=installation_parameters ms=menu_selection
        IF menu_selection = '+QUIT' THEN
           menu_selection_chosen = false
        IFEND
      ELSEIF selection = 'CONSOLE_USAGE_ONLY' THEN
        installation_parameters.installation_option = 'NONE'
        installation_parameters.activation_option = 'CONSOLE'
      IFEND

    ELSE

      EXIT get_input

    IFEND

  WHILEND get_input

  EXIT procedure WITH local_status WHEN NOT local_status.normal

PROCEND rap$get_initial_option
