File: bexec.f

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (66 lines) | stat: -rw-r--r-- 1,693 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
      subroutine bexec(str,ns,ierr)
c     ==========================================================
c     This routine prepare execution of a scilab  instruction (given 
c     in a character string str) within a C 
c     or fortran procedure
c     ==========================================================
c     Copyright INRIA
      include '../stack.h'
      integer sadr,iadr
      character*(*) str
      integer retu(6),comma,eol
c
      data retu/27,14,29,30,27,23/,comma/52/,eol/99/
c
      iadr(l)=l+l-1
      sadr(l)=(l/2)+1
c
      ierr=0
      if (ddt .eq. 4) then
         write(buf(1:12),'(i4)') top
         call basout(io,wte,' bexec2  top:'//buf(1:4))
      endif
c
      mrhs=0
      fin=0
c
c     create a scilab variable of type string in the top of the stack
c     this variable will contain the input string concatenate with 
c     the string of length 10 :   ',return,<eol><eol>'
      top=top+1
      il=iadr(lstk(top))
      l=il+6
      err=sadr(l+ns+10)-lstk(bot)
      if(err.gt.0) then 
         call error(17)
         return
      endif
c     create the header
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=1
      istk(il+3)=0
      istk(il+4)=1
      istk(il+5)=1+ns+10
c     copy the input string
      call cvstr(ns,istk(l),str,0)
c     concatenate ',return,<eol><eol>'
      l1=l+ns
      istk(l1)=comma
      l1=l1+1
      call icopy(6,retu,1,istk(l1),1)
      l1=l1+6
      istk(l1)=comma
      l1=l1+1
      istk(l1)=eol
      l1=l1+1
      istk(l1)=eol
c     set the end of the variable
      lstk(top+1)=sadr(l1)+1
c     inform scilab of the position of the variable containing
c     instructions 
      fin=lstk(top)
      return
      end