Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
txt2int.f
Go to the documentation of this file.
1  subroutine text_to_int (text, int, flag)
2 c
3 c Passed variables
4 c
5  character text*(*)
6  integer int, flag
7 c
8 c Uses CONV_TO_INT to find the integer equivalent of TEXT.
9 c This just performs the multiplication:
10 c INT = INT*INTSIGN.
11 c Also, it strips off outer blanks.
12 c If there was an error, INT=0 and FLAG=1.
13 c Otherwise, FLAG=0 if everything is ok.
14 c
15  integer start, end
16  integer error
17  parameter(error = 1, no_error = 0, no_text = 0)
18 c
19 c Strip blanks and return if all blanks, setting FLAG=ERROR.
20 c
21  call strip(text, start, end)
22  if (start .eq. no_text) then
23  int = 0
24  flag = error
25  return
26  end if
27 c
28 c Convert to integer.
29 c
30  call conv_to_int(text(start:end), intmag, intsign, flag)
31  if (flag .eq. error) then
32  int = 0
33  else
34  int = intsign * intmag
35  end if
36 c
37  return
38  end
subroutine conv_to_int(text, intmag, intsign, flag)
Definition: cnv2int.f:1
subroutine text_to_int(text, int, flag)
Definition: txt2int.f:1
subroutine strip(text, start, end)
Definition: strpblnk.f:1