6 integer intmag, intsign, flag
11 dimension int_text(limit)
12 integer start, end, char_value
15 parameter(error = 1, no_error = 0)
17 parameter(plus = -5, minus = -3)
19 parameter(ascii_factor = 48)
20 parameter(max_digits = 9)
37 if (
end .gt. limit)
then
46 char_value = ichar(text(start:start)) - ascii_factor
47 int_text(start) = char_value
48 if (char_value .eq. plus)
then
49 if (start .ge. end)
then
55 else if (char_value .eq. minus)
then
56 if (start .ge. end)
then
62 else if ((char_value .ge. 0) .and. (char_value .le. 9))
then
71 char_value = ichar(text(i:i)) - ascii_factor
72 if ((char_value .lt. 0) .or. (char_value .gt. 9))
then
75 int_text(i) = char_value
84 intmag = int_text(start)
85 num_digits =
end - start + 1
86 if ((num_digits .gt. max_digits) .and.
87 & (intmag .gt. 0))
then
94 num_digits = num_digits - 1
95 if ((num_digits .gt. max_digits) .and.
96 & (int_text(i) .gt. 0))
then
99 intmag = 10*intmag + int_text(i)
subroutine conv_to_int(text, intmag, intsign, flag)