Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
strpblnk.f
Go to the documentation of this file.
1  subroutine strip (text, start, end)
2 c
3 c Modifications:
4 c 2014-05-01 RBS: integer*4 to integer
5 c
6  integer start, end
7  character text*(*)
8 c
9  character blank*1
10  parameter(blank = ' ')
11  parameter(no_text = 0)
12 c
13 c Strips off left- and right-most blanks in TEXT by returning
14 c the position of the first (START) and last (END) non-blank
15 c characters. If all blanks or if no text passed, START=END=0.
16 c
17  lentext = len(text)
18 c
19 c Strip left blanks
20 c
21  start = 1
22  do while ((text(start:start) .eq. blank)
23  & .and. (start .le. lentext))
24  start = start + 1
25  end do
26 c
27 c Return if all blanks
28 c
29  if (start .gt. lentext) then
30  start = no_text
31  end = no_text
32  return
33  end if
34 c
35 c Strip right blanks
36 c
37  end = lentext
38  do while (text(end:end) .eq. blank)
39  end = end - 1
40  end do
41 c
42 c write(6,11)lentext,start,end
43 c 11 format(' substring length = ',i2,5x,'start = ',i2,5x,
44 c &'end = ',i2)
45 c write(6,*)text(start:end)
46 c do i=start,end
47 c write(6,10)i,ichar(text(i:i))
48 c end do
49 c 10 format(' text(',i2,') = ',i3)
50 c
51  return
52  end
subroutine strip(text, start, end)
Definition: strpblnk.f:1