<?xml version="1.0" encoding="UTF-8"?>
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
          xmlns:scilab="http://www.scilab.org" xml:id="errclear" xml:lang="en">
    <refnamediv>
        <refname>errclear</refname>
        <refpurpose>clears the last error (if its number matches a given one)</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>
          errclear()
          errclear(n)
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Description</title>
        <para>clears the action (error-handler) connected to error of type
            <literal>n</literal>.
        </para>
        <para>
            If <literal>n</literal> is positive (n &gt; 0), it is the number of
            the cleared error ; otherwise if (n &lt;= 0) all errors are cleared
            (default case).
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example">
a = 1;
try, b = undefinedvariable + a; end
[m,n0] = lasterror();
n0
try, b = undefinedvariable + a; end
errclear()
[m,n] = lasterror();
n
try, b = undefinedvariable + a; end
errclear(100)
[m,n] = lasterror(); n

try, b = undefinedvariable + a; end
errclear(999)
[m,n] = lasterror(); n
        </programlisting>
      <screen><![CDATA[
--> try, b = undefinedvariable + a; end
--> [m,n0] = lasterror();
--> n0
 n0  =
   999.

--> try, b = undefinedvariable + a; end
--> errclear()
--> [m,n] = lasterror();
--> n
 n  =
   0.

--> try, b = undefinedvariable + a; end
--> errclear(100)
--> [m,n] = lasterror(); n
 n  =
   999.

--> try, b = undefinedvariable + a; end
--> errclear(999)
--> [m,n] = lasterror(); n
 n  =
   0.
]]></screen>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="lasterror">lasterror</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
