
  PROCEDURE [INLINE] fsp$build_file_ref_from_elems
    (    path_elements: ^pft$path;
     VAR file_reference: fst$file_reference;
     VAR status: ost$status);

?? PUSH (LISTEXT := ON) ??

    VAR
      element_size: ost$name_size,
      first_blank: integer,
      index: fst$number_of_path_elements,
      position: fst$path_size,
      result: boolean;

    status.normal := TRUE;
    file_reference := ':';
    #scan (pfv$space_character, path_elements^ [1], first_blank, {ignore} result);
    element_size := first_blank - 1;
    file_reference (2, element_size) := path_elements^ [1] (1, element_size);
    position := 1 + element_size;
    FOR index := 2 TO UPPERBOUND (path_elements^) DO
      #scan (pfv$space_character, path_elements^ [index], first_blank, {ignore} result);
      element_size := first_blank - 1;
      IF (position + 1 + element_size) <= fsc$max_path_size THEN
        file_reference (position + 1) := '.';
        file_reference (position + 2, element_size) :=
              path_elements^ [index] (1, element_size);
        position := position + 1 + element_size;
      ELSE
        osp$set_status_condition (cle$file_reference_too_long, status);
      IFEND;
    FOREND;
  PROCEND fsp$build_file_ref_from_elems;

*copyc cle$ecc_file_reference
*copyc fst$file_reference
*copyc fst$number_of_path_elements
*copyc fst$path_size
*copyc ost$name
*copyc pft$path
*copyc clp$trimmed_string_size
*copyc osp$set_status_abnormal
*copyc osp$set_status_condition
*copyc pfv$space_character
?? POP ??
