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

« back to all changes in this revision

Viewing changes to examples/interface-tour/intex7f.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
      subroutine intex7f(fname)
 
2
      character*(*) fname
 
3
C     --------------------------------------------
 
4
      include 'stack.h'
 
5
      logical getrhsvar,scistring
 
6
      logical checklhs,checkrhs
 
7
      common/  ierfeval / iero
 
8
 
 
9
      if(.not.checkrhs(fname,2,2)) return
 
10
      if(.not.checklhs(fname,1,1)) return
 
11
c
 
12
c     get adress of x1
 
13
      if (.not.getrhsvar(1,'d',m1,n1,l1))  return
 
14
c     get adress of x2
 
15
      if (.not.getrhsvar(2,'d',m2,n2,l2))  return
 
16
 
 
17
c     To call a function it is required that its input arguments are
 
18
c     stored in the last positions of the variables stack (it is the
 
19
c     ase here. NOTE that when 
 
20
c     called, the function destroys its input variables and replaces them by 
 
21
c     the output variables. 
 
22
 
 
23
c     Here  function  takes  variables 1 and 2 as inputs and generates output
 
24
c     variables at positions 1.
 
25
 
 
26
c     ibegin must be the index of the first input variable of a_function
 
27
      ibegin=1
 
28
 
 
29
c     execute the disp function
 
30
      mlhs=1
 
31
      mrhs=2
 
32
      if(.not.scistring(ibegin,'disp',mlhs,mrhs)) return
 
33
 
 
34
c     check if an error has occured while running a_function
 
35
      if(err.gt.0) return
 
36
 
 
37
c     Note that disp, as every function which has nothing to return,
 
38
c     creates as output a variable with special type 0.
 
39
 
 
40
c     output variable: 
 
41
 
 
42
c     select index of variables to return
 
43
      lhsvar(1)=1
 
44
      return
 
45
      end
 
46
       
 
47