1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="resume">
4 <refname>resume</refname>
5 <refpurpose>return or resume execution and copy some local variables</refpurpose>
8 <title>Calling Sequence</title>
10 [x1,..,xn]=resume(a1,..,an)
14 <title>Arguments</title>
19 <para>variables in calling environment</para>
25 <para>local variables</para>
31 <title>Description</title>
33 In a function <literal>resume</literal> stops the execution of the function,
34 <literal>[x1,..,xn]=resume(a1,..,an)</literal> stops the execution of the function and put the
35 local variables <literal>ai</literal> in calling environment under names
36 <literal>xi</literal>.
39 In <literal>pause</literal> mode, it allows to return to lower level
40 <literal>[x1,..,xn]=resume(a1,..,an)</literal> returns to lower level and put the local variables
41 <literal>ai</literal> in calling environment under names <literal>xi</literal>.
44 In an <literal>execstr</literal> called by a function <literal>[..]=resume(..)</literal> stops
45 the execution of the function and put the local variables
46 <literal>ai</literal> in calling environment under names <literal>xi</literal>.
49 <literal>resume</literal> is equivalent to <literal>return</literal>.
53 Note: the usage of this feature can complexify the code. Instead, the syntax <code>function b = foo()</code> is recommended.
58 <title>Examples</title>
59 <programlisting role="example"><![CDATA[
67 assert_checkequal(b,43);
71 <programlisting role="example"><![CDATA[
73 // with several function calls
78 [x,y,z]=resume(a, b, c)
87 // x y z does not exist here
90 <refsection role="see also">
91 <title>See Also</title>
92 <simplelist type="inline">
94 <link linkend="abort">abort</link>
97 <link linkend="break">break</link>
100 <link linkend="pause">pause</link>
103 <link linkend="quit">quit</link>
106 <link linkend="return">return</link>
109 <link linkend="execstr">execstr</link>