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

« back to all changes in this revision

Viewing changes to macros/tksci/browsevar.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 browsevar()
 
2
// Variable Browser
 
3
// This file is part of sciGUI toolbox
 
4
// Copyright (C) 2004 Jaime Urzua Grez
 
5
// mailto:jaime_urzua@yahoo.com
 
6
// rev. 0.2 2004/06/24
 
7
//
 
8
// This program is free software; you can redistribute it and/or modify
 
9
//it under the terms of the GNU General Public License as published by
 
10
//the Free Software Foundation; either version 2 of the License, or
 
11
//(at your option) any later version.
 
12
  
 
13
  sciGUI_init();
 
14
 
 
15
  [%_nams,%_vol]=who('get');
 
16
  p=predef();
 
17
  sz=stacksize();
 
18
  u=file('open',TMPDIR+'/browsevar.txt','unknown');
 
19
  for %_k=1:size(%_nams,1)
 
20
    %_sz=' ';
 
21
    execstr('%_typ=type('+%_nams(%_k)+')')
 
22
    if (%_typ<=10) then execstr('%_sz=size('+%_nams(%_k)+');'),end
 
23
    if ((%_typ==17)|(%_typ==16)) then
 
24
      execstr('%_tt=getfield(1,'+%_nams(%_k)+')');%_tt=%_tt(1);
 
25
      ierr=execstr('%_sz=%'+%_tt+'_size('+%_nams(%_k)+')','errcatch'); // ?
 
26
      if ierr<>0 then %_sz='?',end
 
27
    end
 
28
    
 
29
    fprintf(u,"<d>%d {%s} %d {%s}",%_typ,strcat(string(%_sz),' by '),%_vol(%_k),%_nams(%_k));
 
30
  end
 
31
  fprintf(u,"<m>%d %d %d",sz(1),sz(2),sz(2)/sz(1)*100);
 
32
  fprintf(u,"<p>%d",p);
 
33
  file('close',u);
 
34
 
 
35
  tmpDir=strsubst(TMPDIR,'\','/');
 
36
  TK_EvalStr('sciGUIBrowseVar ""'+tmpDir+'""');
 
37
endfunction
 
38