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