forked from wangsl/python-embedding
-
Notifications
You must be signed in to change notification settings - Fork 2
/
linend.F
36 lines (33 loc) · 797 Bytes
/
linend.F
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
29
30
31
32
33
34
35
36
C $Id: linend.F 72 2013-12-06 14:04:06Z wangsl $
integer function linend(cline)
implicit real*8(a-h,o-z)
c
c function which returns the length of a character string,
c excluding trailing blanks, tabs and nulls.
c
character*(*) cline, blank
character*1 null, tab
parameter (blank=' ')
c
null = char(0)
tab = char(9)
do 5 i = len(cline), 1, -1
if(cline(i:i).ne.blank.and.
$ cline(i:i).ne.null.and.
$ cline(i:i).ne.tab) goto 10
5 continue
linend = 0
return
10 linend = i
return
end
#if 0
SubRoutine LinEnd2(CLine, Len)
Implicit None
Character*(*) CLine
Integer Len
Include 'linend.i'
Len = LinEnd(CLine)
Return
End
#endif