[scilab-Users] addmenu

Samuel GOUGEON Samuel.Gougeon at univ-lemans.fr
Wed Oct 20 15:11:46 CEST 2010


  Hello,

----- Message d'origine -----
De : Jens Simon
Date : 20/10/2010 14:54:
> Hallo Scilab experts,
> In the test code
> ---------------------------------------------------------------------------------
> function foo(x)
> disp("break will be ignored."), halt(), break,
> endfunction
>
> addmenu('END',list(2,'foo'));
> n=5000;
> for i=1:n,   disp(i), end
> delmenu('END');
> ---------------------------------------------------------------------------------
>
> the "break command is not executed. What has to be modified?
What do you expect from the break here ?
break is used for escaping a for or a while loop.
For escaping the remaining instructions in a function,
the right instruction is return, or equivalently resume.
Since there is no remaining instruction in your
example, "return" would look useless.

HTH
Samuel




More information about the users mailing list