Purpose
Returns the length of a character
entity. The argument to this function need not be defined.
Argument type and attributes
- STRING
- must be of type character. It may be scalar or array valued. If
it is an unallocated allocatable or a pointer that is not associated,
its length type parameter must not be deferred.
- KIND (optional)
- must be a scalar integer constant expression.
Result type and attributes
- It is of type scalar integer.
- If KIND is present,
the KIND type parameter is that specified
by the value of KIND; otherwise, the KIND type
parameter is that of default integer type.
Result value
The result has a value equal
to the number of characters in STRING if it is scalar or in an element
of STRING if it is array valued.
Examples
If C is declared by the statement
CHARACTER (11) C(100)
LEN (C)
has the value 11.
Specific Name |
Argument Type |
Result Type |
Pass As Arg? |
LEN |
default character |
default integer |
yes 1 |
Note: - 1 IBM Extension: the
ability to pass the name as an argument.
|