c integer function getlen(string) c from Koffman and Freidman, "Fortran" c determines the length of atring excluding any blank padding c input: string is defined c output: the function result is the actual string lenth c and includes only the character preceding the padding implicit none character *(*) string character *1 blank parameter (blank = ' ') integer next c start with last character and find the first nonblank do next = len(string),1,-1 if (string(next:next) .ne. blank) then getlen = next return endif enddo c otherwise, all characters are blanks getlen = 0 return end