<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA - Serge STEER
 * ...
 *
 * 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="mputl" xml:lang="en">
    <refnamediv>
        <refname>mputl</refname>
        <refpurpose>writes strings in a text file</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>r = mputl(txt, file_desc)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>r</term>
                <listitem>
                    <para>
                        returns <literal>%t</literal> or <literal>%f</literal> to check
                        if function has correctly wrote on the file.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>file_desc</term>
                <listitem>
                    <para>
                        a character string giving the name of the file or
                    </para>
                    <para>
                        an integer scalar: a file descriptor returned by
                        <function>mopen</function> function.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>txt</term>
                <listitem>
                    <para>a vector of strings.</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <function>mputl</function> function allows to write a vector of
            strings as a sequence of lines in a text file.
        </para>
        <para>
            <function>mputl</function> supports strings encoded as ANSI/ASCII and UTF-8.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
fd = mopen(TMPDIR+'/text_mputl.txt','wt');
mputl('Hello World',fd);
mclose(fd);

mputl('Simple Hello World',TMPDIR+"/text_mputl_simple.txt");

fd = mopen(TMPDIR+'/text_mputl.txt','rt');
disp(mgetl(fd));
mclose(fd);
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="mget">mget</link>
            </member>
            <member>
                <link linkend="mgetl">mgetl</link>
            </member>
            <member>
                <link linkend="mclose">mclose</link>
            </member>
            <member>
                <link linkend="mfprintf">mfprintf</link>
            </member>
            <member>
                <link linkend="mput">mput</link>
            </member>
            <member>
                <link linkend="mputstr">mputstr</link>
            </member>
            <member>
                <link linkend="mopen">mopen</link>
            </member>
            <member>
                <link linkend="write">write</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
