1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2008 - INRIA
7 * This file must be used under the terms of the CeCILL.
8 * This source file is licensed as described in the file COPYING, which
9 * you should have received as part of this distribution. The terms
10 * are also available at
11 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
14 <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="fprintf">
16 <refname>fprintf</refname>
18 Emulator of C language fprintf function. <emphasis role="bold">This function is obsolete.</emphasis>
22 <title>Calling Sequence</title>
23 <synopsis>fprintf(file, format, value_1, ..., value_n)</synopsis>
26 <title>Arguments</title>
31 <para>a Scilab string. It specifies a character string combining literal characters with conversion specifications.</para>
38 specifies the data to be converted according to the <varname>format</varname> parameter.
46 a Scilab string specifying a file name or a logical unit number (see <link linkend="file">file</link>)
49 Note that if <varname>file</varname>=0, the message will be display on standard error stream (stderr).
56 <title>Description</title>
59 This function is obsolete and will be removed in Scilab 5.5.0, use preferabily the <link
60 linkend="mfprintf">mfprintf</link> function which is much more
61 compatible with the C <function>fprintf</function> functionalities.
65 The <function>fprintf</function> function converts, formats, and writes
66 its <varname>value</varname> parameters, under control of the <varname>format</varname>
67 parameter, to the file specified by its <varname>file</varname> parameter.
70 The <varname>format</varname> parameter is a character string that contains two
75 <term>Literal characters</term>
77 <para>which are copied to the output stream.</para>
81 <term>Conversion specifications</term>
84 each of which causes zero or more items to be fetched from the <varname>value</varname> parameter list. See <link linkend="printf_conversion">printf_conversion</link> for details.
90 If any <varname>value</varname>s remain after the entire <varname>format</varname> has been
91 processed, they are ignored.
95 <title>Examples</title>
96 <programlisting role="example"><![CDATA[
97 u=file('open',fullfile(TMPDIR,'results'),'unknown') //open the result file
100 fprintf(u,'time = %6.3f value = %6.3f',tk,sin(tk)) // write a line
102 file('close',u) //close the result file
104 fprintf(0,'My error which is going to be displayed on the stderr')
108 <title>History</title>
111 <revnumber>5.4.1</revnumber>
112 <revremark>Function tagged as obsolete. Will be removed in 5.5.0.</revremark>
116 <refsection role="see also">
117 <title>See Also</title>
118 <simplelist type="inline">
120 <link linkend="mfprintf">mfprintf</link>
123 <link linkend="string">string</link>
126 <link linkend="print">print</link>
129 <link linkend="write">write</link>
132 <link linkend="format">format</link>
135 <link linkend="disp">disp</link>
138 <link linkend="file">file</link>
141 <link linkend="mprintf">mprintf</link>
144 <link linkend="msprintf">msprintf</link>
147 <link linkend="printf_conversion">printf_conversion</link>