~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/scicos/script2var.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function [%ll,%ierr]=script2var(%txt,%ll)
 
2
  %ierr=0
 
3
  %mm=getfield(1,%ll)
 
4
  for %mi=%mm(3:$)
 
5
    if execstr(%mi+'=%ll(%mi)','errcatch')<>0 then
 
6
      disp(lasterror())
 
7
      %ierr=1
 
8
      return
 
9
    end
 
10
  end
 
11
  
 
12
  //  deff('%toto_()',%txt)
 
13
  //  %ierr=exec(%toto_,'errcatch',-1)
 
14
  //  %mm=macrovar(%toto_)
 
15
  //  %mm=%mm(5)
 
16
  [%ll,%ierr]=getvardef(%txt,%ll)
 
17
  if %ierr<>0 then 
 
18
    return,
 
19
  end
 
20
endfunction
 
21
 
 
22
function [%ll,%ierr]=getvardef(%txt,%ll)
 
23
  %nww='';%ierr=0;  // to make sure %ww does not enter the difference
 
24
  %nww=size(who('get'),'*')
 
25
  %ierr=execstr(%txt,'errcatch')
 
26
  if %ierr<>0 then 
 
27
    return,
 
28
  end
 
29
  %mm=who('get')
 
30
  %nww2=size(%mm,'*')
 
31
  %mm=%mm(1:%nww2-%nww)
 
32
  for %mi=%mm(:)'
 
33
    %ll(%mi)=evstr(%mi)
 
34
  end
 
35
endfunction