Revision 5 src/upcase.f90

upcase.f90 (revision 5)
8 8
        integer, parameter :: KINT = kind(1)
9 9

  
10 10
        CHARACTER(*), INTENT(INOUT) :: String
11
        INTEGER(KINT) :: i,ic, length
11
        INTEGER(KINT) :: i,ic, length,Del,ia,iz
12

  
13
! We define some variables
14
! By doing this, we do not depend on the ASCII coding of the
15
! characters
16
        DEL = IACHAR('a') - IACHAR('A')
17
        ia=IACHAR('a')
18
        iz=IACHAR('z')
19

  
12 20
        length=len_trim(string)
13 21
        DO I=1, length
14 22
          ic=ICHAR(String(i:i))
15
          if ((ic.ge.97).and.(ic.le.122)) ic=ic-32
23
          if ((ic.ge.ia).and.(ic.le.iz)) ic=ic-DEL
16 24
          String(i:i)=ACHAR(ic)
17 25
        END DO
18 26

  

Also available in: Unified diff