<?xml version="1.0" encoding="UTF-8"?>
<!--
 *
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2010 - 2011 - DIGITEO - Michael Baudin
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<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="assert_checktrue" xml:lang="en">
    <refnamediv>
        <refname>assert_checktrue</refname>
        <refpurpose>Check that condition is true.</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>
            flag = assert_checktrue ( condition )
            flag = assert_checktrue ( condition )
            [flag,errmsg] = assert_checktrue ( condition )

        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Parameters</title>
        <variablelist>
            <varlistentry>
                <term>condition:</term>
                <listitem>
                    <para> a matrix of booleans</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>flag :</term>
                <listitem>
                    <para> a 1-by-1 matrix of boolean, %t if condition is true, %f if not</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>errmsg :</term>
                <listitem>
                    <para> a 1-by-1 matrix of strings, the error message. If flag==%t, then errormsg=="". If flag==%f, then errmsg contains the error message.</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            Performs silently if all entries in <literal>condition</literal> are true.
        </para>
        <para>
            Generates an error if any entry in the <literal>condition</literal> matrix
            is false.
            Generates an error if <literal>condition</literal> is not a boolean.
        </para>
        <para>
            If any entry in condition is false,
            <itemizedlist>
                <listitem>
                    <para>if the errmsg output variable is not used, an error is generated,</para>
                </listitem>
                <listitem>
                    <para>if the errmsg output variable is used, no error is generated.</para>
                </listitem>
            </itemizedlist>
        </para>
        <para>
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
// Tests which pass
assert_checktrue ( %t );
flag = assert_checktrue ( %t )
[flag,errmsg] = assert_checktrue ( %t )
[flag,errmsg] = assert_checktrue ( [%t %t] );

// Tests which fail
assert_checktrue ( [%t %f] );
flag = assert_checktrue ( [%t %f] )
// No error generated
[flag,errmsg] = assert_checktrue ( [%t %f] )

// Wrong calls
assert_checktrue ( "a" )

   ]]></programlisting>
    </refsection>
    <refsection>
        <title>History</title>
        <revhistory>
            <revision>
                <revnumber>5.4.0</revnumber>
                <revdescription>Function introduced
                </revdescription>
            </revision>
        </revhistory>
    </refsection>
</refentry>
