comparison scripts/testfun/demo.m @ 21634:96518f623c91

Backed out changeset dcf8922b724b
author Mike Miller <mtmiller@octave.org>
date Wed, 20 Apr 2016 11:06:03 -0700
parents dcf8922b724b
children b45d53d1d638
comparison
equal deleted inserted replaced
21633:dcf8922b724b 21634:96518f623c91
136 try 136 try
137 block = code(idx(doidx(i)):idx(doidx(i)+1)-1); 137 block = code(idx(doidx(i)):idx(doidx(i)+1)-1);
138 ## Use an environment without variables 138 ## Use an environment without variables
139 eval (["function __demo__ ()\n" block "\nendfunction"]); 139 eval (["function __demo__ ()\n" block "\nendfunction"]);
140 ## Display the code that will be executed before executing it 140 ## Display the code that will be executed before executing it
141 fprintf ("%s example %d:%s\n\n", name, doidx(i), block); 141 printf ("%s example %d:%s\n\n", name, doidx(i), block);
142 __demo__; 142 __demo__;
143 catch 143 catch
144 ## Let the programmer know which demo failed. 144 ## Let the programmer know which demo failed.
145 fprintf ("%s example %d: failed\n%s\n", name, doidx(i), lasterr ()); 145 printf ("%s example %d: failed\n%s\n", name, doidx(i), lasterr ());
146 end_try_catch 146 end_try_catch
147 clear __demo__; 147 clear __demo__;
148 endfor 148 endfor
149 149
150 endfunction 150 endfunction