PROCEDURE rap$get_catalog_file_names (
  catalog, c: file = $required
  names, n: (VAR) list 0..$max_list of name = $required
  status)


  "$FORMAT=OFF
  VAR
    catalog_list: list 0..$max_list of string 0..60
    file_name: name
    ignore_status: status
    local_status: status
    scratch_file: file = $unique($local)
  VAREND
  "$FORMAT=ON"


*IF $variable(wev$proc_doc,declared)<>'UNKNOWN'
"
"  This routine processes the display_catalog list and locates all
"  file names in the specified catalog.  The result is a list of
"  these file names.
"
*IFEND


  main_block: ..
    BLOCK

  names = ()

  $system.set_file_attributes f=scratch_file pf=continuous
  $system.display_catalog c=catalog do=identifier o=scratch_file status=local_status
  EXIT main_block WHEN NOT local_status.normal

  $system.get_lines v=catalog_list i=scratch_file status=local_status
  EXIT main_block WHEN NOT local_status.normal

  catalog_list = $select(catalog_list, x(1, 10)='    FILE: ')
  names = $apply(catalog_list, $name(x(11, $size(x)-10)))

  BLOCKEND main_block

  $system.delete_file f=scratch_file status=ignore_status

  EXIT procedure WITH local_status WHEN NOT local_status.normal

PROCEND rap$get_catalog_file_names
