M507: Occupied Length of a Character String

Author(s): F. Rademakers, J. Zoll Library: KERNLIB
Submitter: Submitted: 27.11.1984
Language: Fortran or C Revised: 05.05.1992

LENOCC returns the occupied length of a string of type CHARACTER.

Structure:

FUNCTION subprogram
User Entry Names: LENOCC

Usage:

In any arithmetic expression,

LENOCC(LINE)

has the value of the occupied length of the character string LINE, i.e. the length up to and including the last non-blank character. tex2html_wrap_inline63 if LINE contains blanks only. LINE is of type CHARACTER and LENOCC is of type INTEGER.

For few trailing blanks LENOCC is slower than LNBLNK of M432, but it may be substantially faster for very many trailing blanks; the break-even point depends on the machine and is usually around 25 trailing blanks.

Method:

On some machines LINE is first scanned backwards for machine words containing all blanks, and then the remaining string is scanned for the last non-blank character.
tex2html_wrap_inline65


Michel Goossens Wed Jun 5 07:47:41 METDST 1996