9.3.82 LEN (STRING [, KIND])

Description:  Returns the length of a character expression.  
Class:  Inquiry function; Generic 
Arguments:  STRING Must be of type character; it can be scalar or array valued.  
  KIND (opt) Must be a scalar integer initialization expression.  
Results:  The result is a scalar of type integer. If KIND is present, the kind parameter of the result is that specified by KIND; otherwise, the kind parameter of the result is that of default integer. If the processor cannot represent the result value in the kind of the result, the result is undefined.

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).

The setting of compiler options that specify integer size can affect the result of this function. 

Specific Name  Argument Type  Result Type 
LEN  CHARACTER  INTEGER(4) 
  CHARACTER  INTEGER(8) 

Examples

Consider the following example:

  CHARACTER (15) C (50)
  CHARACTER (25) D

LEN (C) has the value 15, and LEN (D) has the value 25.


Previous Page Next Page Table of Contents