
  PROCEDURE [INLINE] fip#addl_trimmed_string
    (VAR line: ost$string;
         str: string ( * );
         trim_option: fit#addl_trim_option;
         trim_character: char);

?? PUSH (LISTEXT := ON) ??

    VAR
      first: integer,
      last: ost$string_size;

    last := STRLENGTH (str);

    IF (trim_option = fic#ato_trailing) OR
          (trim_option = fic#ato_leading_and_trailing) THEN
      IF str (1) <> trim_character THEN
        WHILE (str (last) = trim_character) DO
          last := last - 1;
        WHILEND;
      ELSE
        WHILE (last > 0) AND (str (last) = trim_character) DO
          last := last - 1;
        WHILEND;
      IFEND;
    IFEND;

    first := 1;
    IF (trim_option = fic#ato_leading) OR
          (trim_option = fic#ato_leading_and_trailing) THEN
      WHILE (first <= last) AND (str (first) = trim_character) DO
        first := first + 1;
      WHILEND;
    IFEND;

    fip#addl_string (line, str (first, last - first + 1));

  PROCEND fip#addl_trimmed_string;

*copyc fip#addl_string
*copyc fit#addl_trim_option

*copyc ost$string
?? POP ??

