
PROCEDURE dum$get_path_string, get_path_string, get_path (
  pde_offset, po: integer = $required
  path, p: (VAR) string = $optional
  status)

  "$FORMAT=OFF"
  VAR
    entry_type: integer
    path_node_name_size: integer
    path_string: string
    "offsets & lengths
    cycle_number_length: integer
    cycle_number_offset: integer
    entry_type_length: integer
    entry_type_offset: integer
    length: integer
    offset: integer
    parental_path_entry_offset: integer
    path_node_name_size_length: integer
    path_node_name_size_offset: integer
    path_node_name_value_offset: integer
    "addresses
    address: integer
    parental_path_address: integer
    pde_address: integer=(200400000000(16)+$value(pde_offset))
  VAREND
  "$FORMAT=ON"

  IF $specified(path) THEN
    path = ' unknown path '
  IFEND
  fmt$path_description_entry field=parental_path_entry offset=offset length=length
  parental_path_entry_offset = offset/8

  fmt$path_description_entry field=entry_type offset=offset length=length
  entry_type_offset = offset/8
  entry_type_length = length/8

  fmt$path_description_entry field=path_node_name offset=offset length=length
  fst$path_element field=value offset=path_node_name_value_offset length=length
  path_node_name_value_offset = (offset+path_node_name_value_offset)/8

  fst$path_element field=size offset=path_node_name_size_offset length=length
  path_node_name_size_offset = (offset+path_node_name_size_offset)/8
  path_node_name_size_length = length/8

  fmt$path_description_entry field=cycle_number offset=offset length=length
  cycle_number_offset = offset/8
  cycle_number_length = length/8

  entry_type = $memory((pde_address+entry_type_offset), entry_type_length)
  IF entry_type = 1 THEN
    path_string = '.'//$strrep($memory((pde_address+cycle_number_offset), cycle_number_length))
    parental_path_address = $memory((pde_address+parental_path_entry_offset))
  ELSE
    parental_path_address = pde_address
  IFEND
  WHILE NOT $nil_pva(parental_path_address) DO
    path_node_name_size = $memory((parental_path_address+path_node_name_size_offset), ..
          path_node_name_size_length)
    path_string = '.'//..
$memory_string((parental_path_address+path_node_name_value_offset), path_node_name_size)//path_string
    parental_path_address = $memory((parental_path_address+parental_path_entry_offset))
  WHILEND
  path_string(1) = ':'
  IF $specified(path) THEN
    path = path_string
  ELSE
    display_value v=path_string o=$output
  IFEND

PROCEND dum$get_path_string
