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

« back to all changes in this revision

Viewing changes to routines/system/setgetmode.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
      integer function setgetmode(id)
 
2
c     Determine if stackg may get the variable id by reference (-4) or
 
3
c      by value (0)
 
4
c     
 
5
c     Copyright INRIA
 
6
      include '../stack.h'
 
7
c
 
8
      integer plus,minus,comma,rparen
 
9
      external allowptr
 
10
      logical allowptr
 
11
      data plus/45/,minus/46/,comma/52/,rparen/42/
 
12
 
 
13
 
 
14
 
 
15
      imode=0
 
16
      if(sym.eq.plus.or.sym.eq.minus) then
 
17
c         imode=-2
 
18
         call cvname(id,buf,1)
 
19
c         call basout(io,wte,' setgetmode '//buf(1:nlgh)//'+- ')
 
20
         goto 33
 
21
      endif
 
22
 
 
23
      if(rstk(pt).ne.201.or.
 
24
     $     rstk(pt-1).ne.101.or.pstk(pt-1).ne.301.or.
 
25
     $     rstk(pt-2).ne.307) goto 33
 
26
c     pstk(pt-1).ne.301 checks if name is not preceeded by a minus sign
 
27
c     name is a first factor of an argument or subscript 
 
28
      ip=pt-2
 
29
 
 
30
 31   if (sym.ne.comma.and.sym.ne.rparen) goto 33
 
31
c     name is followed by a , or a )
 
32
      
 
33
c     variable is an argument of a function
 
34
 32   continue
 
35
      ifun=ids(1,ip)
 
36
      if (allowptr(ifun).or.ifun.lt.0) then
 
37
         if(ddt.ge.4) then
 
38
            call cvname(id,buf,1)
 
39
            write(buf(nlgh+1:nlgh+16),'(2i8)') ifun,rstk(ip)
 
40
            call basout(io,wte,' setgetmode '//buf(1:nlgh)//' '//
 
41
     $           buf(nlgh+1:nlgh+16))
 
42
         endif
 
43
         imode=-4
 
44
      endif
 
45
 33   setgetmode=imode
 
46
      return
 
47
      end
 
48