PROCEDURE choose_ica_type (
  ica_type: (VAR) string = $optional
  )

" This procedure prompts the user for the type of ICA to define
" as part of the network configuration. The user may choose to
" define an OSI mode ICA-II under option #1, or may choose option
" #2 to define an ICA-I or a native mode ICA-II.

"$ format = off
  VAR
    choice: string
  VAREND

"$ format = on


main_loop: ..
  LOOP

"$ format = off
    put_line (..
        '1Choose ICA type'..
        '01. Define Network Connection (ICA-II running in OSI mode)'..
        ' 2. Define Network Access (ICA-I or ICA-II running in native mode)'..
        '0Enter a menu selection, QUIT, ?: ')
"$ format = on

    choice = ' '
    accept_line choice input p=''

    IF choice = '1' THEN
      ica_type = 'DEFINE_NETWORK_CONNECTION'
      EXIT main_loop
    ELSEIF choice = '2' THEN
      ica_type = 'DEFINE_NETWORK_ACCESS'
      EXIT main_loop
    ELSEIF ($translate(lower_to_upper, choice) = 'QUIT') OR ($translate(lower_to_upper, choice) = 'QUI') THEN
      ica_type = ' '
      EXIT main_loop
    ELSEIF choice = '?' OR ($translate(lower_to_upper, choice) = 'HELP') THEN

"$ format = off
      put_line (..
            '0This menu prompts you to choose the type of ICA on your mainframe ' ..
            ' and in the case of an ICA-II, the mode in which the ICA-II will run. '..
            '01.  Select number 1 if your mainframe is connected to the network '..
            '     via an ICA-II which you want to run in OSI mode. It is recommended '..
            '     that all ICA-II''s be defined to run in OSI mode. Note that '..
            '     an OSI mode ICA-II will also support XNS traffic. '..
            '02.  Select number 2 if your mainframe is connected to the network ' ..
            '     via  an ICA-I, or an ICA-II which you want to run in native '..
            '     mode (i.e., ICA-I emulation mode). '..
            '0Enter QUIT to return to the main menu without choosing a network ' ..
            '   type. '..
            '  ')
"$ format = on

      accept_line choice input p='Press NEXT: '
    IFEND
  LOOPEND main_loop

PROCEND choose_ica_type
