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);
72 <refsection role="see also">
73 <title>See Also</title>
74 <simplelist type="inline">
76 <link linkend="abort">abort</link>
79 <link linkend="break">break</link>
82 <link linkend="pause">pause</link>
85 <link linkend="quit">quit</link>
88 <link linkend="return">return</link>
91 <link linkend="execstr">execstr</link>