PROCEDURE prompt_for_host_network (
  host_network: (var) string = $required
  status: (var) status = $optional
  )

" This procedure prompts the user for the host network identifer.


" Make local copies of procedure parameters.

  host_network_id = host_network

  "$FORMAT=OFF
  VAR
    choice: string
    cr_requested: string
    hex_network_value: string
    network_string: string
    processor_serial_number: string
  VAREND
  "$FORMAT=ON"

  processor_serial_number =  $processor(serial_number, 0)
  IF $processor(serial_number, 1) <> '' THEN
    processor_serial_number = processor_serial_number // ',' //$processor(serial_number, 1)
  IFEND
  title = ' ' // $processor(model, 0) // ' SN' // processor_serial_number

main_loop: ..
  LOOP
    IF host_network_id = ' ' THEN
      network_string = ' '
    ELSE
      hex_network_value = $strrep($integer(host_network_id), 16) // '(16)'
      network_string = host_network_id // ' or ' // hex_network_value
    IFEND

"$ format=off
    put_line (..
     '1Define Host Network for:'..
     title ..
     '01. Network Identifier ................. '//network_string ..
     '0Enter a menu selection, QUIT, GO, or ?:'..
     )
"$ format=on

    choice = ' '
    accept_line choice input p=''

    IF choice = '1' THEN
      prompt_for_network_id ve host_network_id
    ELSEIF ($translate(lower_to_upper, choice) = 'QUIT') OR ($translate(lower_to_upper, choice) = 'QUI') THEN
      host_network = ' '
      EXIT main_loop
    ELSEIF (choice = '?') OR ($translate(lower_to_upper, choice) = 'HELP') THEN

"$ format=off
      put_line (..
        '0With this menu you define the host network identifier. This identifier does'..
        ' not identify a physical network, but rather a "pseudo network" by which'..
        ' this host will be known in the CDCNET concatenated network (catenet).'..
        ' It is used for routing messages over the OSI protocol stack.  Hence, the ' ..
        ' network identifier must be unique among all network identifiers assigned' ..
        ' within this catenet.'..
        '0You must specify the network identifier for the host network.  No'..
        ' default value is provided.'..
        '0Enter a ''1'' to supply the host network identifier.'..
        ' Enter GO or press NEXT to accept the current host network identifier and'..
        '   proceed to the next menu.'..
        ' Enter QUIT to return to the previous menu without defining the host network.'..
        )
"$ format=on
      accept_line cr_requested input p='Press NEXT:'
    ELSEIF (choice = ' ') OR ($translate(lower_to_upper, choice) = 'GO') THEN
      IF host_network_id = ' ' THEN
        accept_line cr_requested input p='Network identifier needed, press NEXT: '
      ELSE
        put_line ('0Host network id accepted.' '  ')
        accept_line cr_requested input p='Press NEXT: '
        host_network = host_network_id
        EXIT main_loop
      IFEND
    ELSE
      accept_line cr_requested input p='Invalid selection, press NEXT: '
    IFEND

  LOOPEND main_loop

PROCEND prompt_for_host_network
