File: getstr.f

package info (click to toggle)
scilab 4.0-12
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 100,640 kB
  • ctags: 57,333
  • sloc: ansic: 377,889; fortran: 242,862; xml: 179,819; tcl: 42,062; sh: 10,593; ml: 9,441; makefile: 4,377; cpp: 1,354; java: 621; csh: 260; yacc: 247; perl: 130; lex: 126; asm: 72; lisp: 30
file content (82 lines) | stat: -rw-r--r-- 2,174 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
      subroutine getstr
c ====================================================================
c             interpretation d une chaine de caracteres
c               et rangement dans la base de donnees
c ====================================================================
c     Copyright INRIA
      include '../stack.h'
      integer quote,eol,bl(nsiz),iadr,sadr
      logical cresmat
      data quote/53/,eol/99/, bl/nsiz*673720360/
c
      iadr(l)=l+l-1
      sadr(l)=(l/2)+1
c
      fin=1
C     maximum number of characters that we can store
      ilmax=iadr(lstk(bot)-1)
      n = 0
c
      if(comp(1).ne.0)then
c     compilation [3 nombre-de-char char1 ,....]
c     on ne sait pas encore combien il y en a
         lkp=comp(1)
         err=sadr(lkp+2)-lstk(bot)
         if(err.gt.0) then
            call error(17)
            return
         endif
         istk(lkp)=3
         ln=lkp+2
         l0=lkp+1
         comp(1)=lkp
      else
         if(top+2.ge.bot) then
            call error(18)
            return
         endif
         if(err1.le.0) then
            top=top+1
            infstk(top)=0
            call putid(idstk(1,top),bl)
            if (.not.cresmat("getstr",top,1,1,1)) return
            ln=iadr(lstk(top))+6
         else
            ln=0
         endif
      endif
c     Begin : reading the string 
      l=ln
      lpt(4) = lpt(3)
      call fortrangetch
   16 if (abs(char1) .eq. quote) go to 18
   17 ln = l+n
      if (char1 .eq. eol) then
         call error(31)
         return
      endif
      if(ln.ge.ilmax) then 
         err=sadr(ln)-lstk(bot)
         call error(17)
         return
      endif
      if(err1.le.0) istk(ln) = char1
      n = n+1
      call fortrangetch
      go to 16
   18 call fortrangetch
      if (abs(char1) .eq. quote) go to 17
c      if (n .le. 0) then
c         call error(31)
c         return
c      endif
c     end reading : the string is stored in istk(ln-> ln+(n-1))
c     Storing size info in data Base
      if(comp(1).ne.0) then 
         istk(l0)=n
         comp(1)=l+n
      elseif(err1.le.0)  then
         if (.not.cresmat("getstr",top,1,1,n)) return
      endif
      return
      end