[bug_14020] mscanf fixed about empty data.
[scilab.git] / scilab / modules / io / help / en_US / input.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) XXXX-2008 - INRIA
5  *
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at
10  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
11  *
12  -->
13 <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">
14     <refnamediv>
15         <refname>input</refname>
16         <refpurpose>prompt for user input</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>x = input(message [, "string"])</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>message</term>
27                 <listitem>
28                     <para>character string</para>
29                 </listitem>
30             </varlistentry>
31             <varlistentry>
32                 <term>"string"  </term>
33                 <listitem>
34                     <para>
35                         the character string <literal>"string"</literal> (may be
36                         abbreviated to <literal>"s"</literal>)
37                     </para>
38                 </listitem>
39             </varlistentry>
40             <varlistentry>
41                 <term>x</term>
42                 <listitem>
43                     <para>real number (or character string if
44                         <literal>"string"</literal> is in the calling sequence)
45                     </para>
46                 </listitem>
47             </varlistentry>
48         </variablelist>
49     </refsection>
50     <refsection>
51         <title>Description</title>
52         <para>
53             <literal>input(message)</literal> gives the user the prompt in the text string and
54             then waits for input from the keyboard.
55             The input can be expression which is evaluated by <link linkend="evstr">evstr</link>.
56             If nothing but a carriage return is
57             entered at the prompt <literal>input(message)</literal> returns an empty matrix.
58         </para>
59         <para>
60             Invoked with two arguments, the output is a character string which is the
61             expression entered at keyboard.  If nothing but a carriage return is
62             entered at the prompt, <literal>input(message)</literal> returns an empty string.
63         </para>
64     </refsection>
65     <refsection>
66         <title>Examples</title>
67         <programlisting role="example"><![CDATA[
68 //x=input("How many iterations?")
69 //x=input("What is your name?","string")
70  ]]></programlisting>
71     </refsection>
72     <refsection role="see also">
73         <title>See Also</title>
74         <simplelist type="inline">
75             <member>
76                 <link linkend="evstr">evstr</link>
77             </member>
78             <member>
79                 <link linkend="x_dialog">x_dialog</link>
80             </member>
81             <member>
82                 <link linkend="x_mdialog">x_mdialog</link>
83             </member>
84             <member>
85                 <link linkend="isempty">isempty</link>
86             </member>
87         </simplelist>
88     </refsection>
89     <refsection>
90         <title>History</title>
91         <revhistory>
92             <revision>
93                 <revnumber>6.0.0</revnumber>
94                 <revremark>
95                     <para>
96                         In case where nothing is entered with the string input argument,
97                         input returns an empty string instead of a space.
98                     </para>
99                 </revremark>
100             </revision>
101         </revhistory>
102     </refsection>
103 </refentry>