Function Type:

Len is a inquiry function for CHARACTER variables and arrays.

Function Purpose:

The len function will return the length of a character variable or array. In other words, it will tell you how many characters can be stored in a character variable or in an element of a character array.

Required Arguments:


String can be the name of either a character variable or the name of a character array.

Note: The function needs to output to a variable of type INTEGER.

Optional Arguments:

There are no optional arguments.


If you had declared the following character variables:
		character*20 grapes(100), word*12
And then passed them to the len function in the following code:
		i = len(grapes)
		j = len(word)
Then i would contain the value of 20 and j would contain the integer 12.

For more information and examples see:

lecture twenty five

examples: plot2.f and charvar.f

Up one level / Home

Written by Jason Wehr : jcw142@psu.edu and Maintained by John Mahaffy : jhm@cac.psu.edu