File: strlen.f

package info (click to toggle)
aces3 3.0.6-7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 82,460 kB
  • sloc: fortran: 225,647; ansic: 20,413; cpp: 4,349; makefile: 953; sh: 137
file content (20 lines) | stat: -rw-r--r-- 438 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
      function strlen(str)
      implicit none
      integer strlen
      character*(*) str
      character*1 spc,tab,zero
      integer i
      i=len(str)
      spc=achar(32)
      tab=achar(9)
      zero=achar(0)
      do while (i.gt.0 .and.
     &          (str(i:i).eq.spc .or.
     &           str(i:i).eq.tab .or.
     &           str(i:i).eq.zero)
     &         )
         i=i-1
      end do
      strlen=i
      return
      end