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

« back to all changes in this revision

Viewing changes to macros/percent/%cblock_p.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 %cblock_p(m)
 
2
n=size(definedfields(m),'*')
 
3
txt=[]
 
4
for k=2:n
 
5
  txt=[txt string(getfield(k,m))]
 
6
end
 
7
l=max(length(txt),'r')
 
8
n=size(txt,2)
 
9
for k=1:n
 
10
  txt(:,k)=part(txt(:,k),1:l(k))
 
11
end
 
12
 
 
13
nlc=lines()
 
14
k1=1
 
15
while %t
 
16
  L=cumsum(l(k1:$)+2)
 
17
  k2=max(find(L<nlc(1)))
 
18
  if k2==[] then k2=k1  ;end
 
19
  t=emptystr(size(txt,1),1)
 
20
  for i=k1:k2
 
21
    t=t+txt(:,i)+'  '
 
22
  end
 
23
  if k1==1&k2==n then disp(t),break,end
 
24
 
 
25
  if k1==k2 then
 
26
    disp(['Column '+string(k1);t])
 
27
  else
 
28
    disp(['Columns '+string(k1)+' to '+string(k2);t])
 
29
  end
 
30
  if k2==n then break,end
 
31
end
 
32
endfunction