File: list_next_int.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 (28 lines) | stat: -rw-r--r-- 593 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
21
22
23
24
25
26
27
28

      subroutine list_next_int(str,ptr,i,err)
      implicit none
      character*(*) str
      integer ptr,err,i
      integer l,pos
      integer  strlen,ncindex
      external strlen,ncindex
      err=0
      l=strlen(str)
      ptr=max(ptr,0)
      ptr=min(ptr,l+1)
      if (ptr.eq.l+1) then
         err=-1
         i=0
         return
      end if
      pos=ncindex(str,',',ptr)
      if (pos.eq.0) then
         call str2int(str(ptr+1:l),i,err)
         pos=l+1
      else
         call str2int(str(ptr+1:pos-1),i,err)
      end if
      if (err.eq.0) ptr=pos
      return
      end