Line data Source code
1 0 : INTEGER FUNCTION NCHAR (TEXT) 2 : C----------------------------------------------------------------------- 3 : C A.J. Hunt - August, 1981. 4 : C 5 : C CHARACTER*n TEXT 6 : C . 7 : C . . 8 : C . 9 : C NCH = NCHAR (TEXT) 10 : C 11 : C NCHAR is an integer function subroutine which returns the number of 12 : C significant characters in a character string. Trailing blanks are 13 : C regarded as insignificant. This differs from the VAX/FORTRAN77 14 : C intrinsic function LEN which returns the defined or passed length 15 : C of the character string including trailing blanks. 16 : C----------------------------------------------------------------------- 17 : CHARACTER*(*) TEXT 18 : INTEGER NN 19 : C----------------------------------------------------------------------- 20 0 : NN = LEN (TEXT) 21 : 22 0 : DO WHILE (NN .GT. 0 .AND. TEXT(NN:NN) .EQ. ' ') 23 0 : NN = NN - 1 24 : END DO 25 : 26 0 : NCHAR = NN 27 0 : RETURN 28 0 : END