~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to routines/system/majmin.f

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
C/MEMBR ADD NAME=MAJMIN,SSI=0
 
2
c     Copyright INRIA
 
3
      subroutine majmin( nc, chain1, chain2)
 
4
c
 
5
c ====================================================================
 
6
c scilab . librairie system
 
7
c ====================================================================
 
8
c
 
9
c        conversion en minuscule d'une chaine en majuscule
 
10
c
 
11
c ====================================================================
 
12
c
 
13
c entree : nc      nombre de caracteres des chaines
 
14
c          chain1  chaine a convertir
 
15
c
 
16
c
 
17
c sortie : chain2  chaine convertie
 
18
c
 
19
c
 
20
c reference fortran : index len min
 
21
c
 
22
c ============================================ (   ) ===========
 
23
c
 
24
      integer        nc
 
25
      character*(*)  chain1,chain2
 
26
c
 
27
      integer        i,i1,n1
 
28
      character*26   minus,majus
 
29
      data minus / 'abcdefghijklmnopqrstuvwxyz' /
 
30
      data majus / 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' /
 
31
c
 
32
      n1 = min ( nc, len(chain1) )
 
33
      if ( n1.le.0 ) goto 100
 
34
      do 10 i=1,n1
 
35
         i1 = index ( majus , chain1(i:i) )
 
36
         if ( i1.eq.0 ) then
 
37
            chain2(i:i) = chain1(i:i)
 
38
         else
 
39
            chain2(i:i) = minus(i1:i1)
 
40
         endif
 
41
   10 continue
 
42
c
 
43
  100 continue
 
44
      end