Add also the examples in core help pages in the russian help page (port of modificati...
[scilab.git] / scilab / modules / core / help / en_US / control_flow / pause.xml
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="pause">
3     <refnamediv>
4         <refname>pause</refname>
5         <refpurpose>pause mode, invoke keyboard</refpurpose>
6     </refnamediv>
7     <refsection>
8         <title>Description</title>
9         <para>
10             Switch to the <code>pause</code> mode;
11             inserted in the code of a function, <code>pause</code> interrupts the execution
12             of the function: one receives a prompt symbol which indicates
13             the level of the <code>pause</code> (e.g. <literal>-1-&gt;</literal>). The user is
14             then in a new workspace in which all the lower-level variables
15             (and in particular all the variable of the function) are available.
16             To return to the calling workspace enter <code>return</code>.
17         </para>
18         <para>
19             In this mode, <literal>[...]=return(...) </literal>
20             returns the variables of the argument <literal>(...)</literal> to the calling workspace with 
21             names in the output <literal>[...]</literal>. Otherwise, the lower-level variables
22             are protected and cannot be modified.
23         </para>
24         <para>
25             The <literal>pause</literal> is extremely useful for debugging purposes.
26         </para>
27         <para>
28             This mode is killed by the command <code>abort</code>.
29         </para>
30     </refsection>
31     <refsection>
32         <title>Examples</title>
33         <programlisting role="example"><![CDATA[ 
34     function c=foo(b)
35     a=42+b
36     disp("Thanks to the pause, you can investigate if ''a'' has the right value");
37     disp("Value can be changed too if needed.");
38     pause
39     c=a+2
40     endfunction
41     
42     foo(2)
43  ]]></programlisting>
44     </refsection>
45     <refsection role="see also">
46         <title>See Also</title>
47         <simplelist type="inline">
48             <member>
49                 <link linkend="halt">halt</link>
50             </member>
51             <member>
52                 <link linkend="return">return</link>
53             </member>
54             <member>
55                 <link linkend="abort">abort</link>
56             </member>
57             <member>
58                 <link linkend="quit">quit</link>
59             </member>
60             <member>
61                 <link linkend="whereami">whereami</link>
62             </member>
63             <member>
64                 <link linkend="where">where</link>
65             </member>
66             <member>
67                 <link linkend="sleep">sleep</link>
68             </member>
69         </simplelist>
70     </refsection>
71 </refentry>