<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) XXXX-2008 - INRIA
 *
 * 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: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="input">
    <refnamediv>
        <refname>input</refname>
        <refpurpose>prompt for user input</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>
            x = input(message)
            x = input(message, "string")
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>message</term>
                <listitem>
                    <para>character string</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>"string"  </term>
                <listitem>
                    <para>
                        the character string <literal>"string"</literal> (may be
                        abbreviated to <literal>"s"</literal>)
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>x</term>
                <listitem>
                    <para>real number (or character string if
                        <literal>"string"</literal> is in the syntax)
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <literal>input(message)</literal> gives the user the prompt in the text string and
            then waits for input from the keyboard.
            The input can be expression which is evaluated by <link linkend="evstr">evstr</link>.
            If nothing but a carriage return is
            entered at the prompt <literal>input(message)</literal> returns an empty matrix.
        </para>
        <para>
            Invoked with two arguments, the output is a character string which is the
            expression entered at keyboard.  If nothing but a carriage return is
            entered at the prompt, <literal>input(message)</literal> returns an empty string.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
//x=input("How many iterations?")
//x=input("What is your name?","string")
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="evstr">evstr</link>
            </member>
            <member>
                <link linkend="x_dialog">x_dialog</link>
            </member>
            <member>
                <link linkend="x_mdialog">x_mdialog</link>
            </member>
            <member>
                <link linkend="isempty">isempty</link>
            </member>
        </simplelist>
    </refsection>
    <refsection>
        <title>History</title>
        <revhistory>
            <revision>
                <revnumber>6.0.0</revnumber>
                <revremark>
                    <para>
                        In case where nothing is entered with the string input argument,
                        input returns an empty string instead of a space.
                    </para>
                </revremark>
            </revision>
        </revhistory>
    </refsection>
</refentry>
