FUNCTION rap$line_length (line: string(*)) : integer;

  VAR
    i: integer;

  rap$line_length := 0;
  /SKIP_TRAILING_BLANKS/
  FOR i := strlength(line) DOWNTO 1 DO
    IF line(i) <> ' ' THEN
      rap$line_length := i;
      EXIT /SKIP_TRAILING_BLANKS/;
    IFEND;
  FOREND /SKIP_TRAILING_BLANKS/;
FUNCEND rap$line_length;

