add checkNamedArguments function to get unexpected named arguments.
[scilab.git] / scilab / modules / core / help / en_US / variables / checkNamedArguments.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <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="checkNamedArguments">
3     <refnamediv>
4         <refname>checkNamedArguments</refname>
5         <refpurpose>Return list of unexpected named arguments</refpurpose>
6     </refnamediv>
7     <refsynopsisdiv>
8         <title>Syntax</title>
9         <synopsis>names = checkNamedArguments()</synopsis>
10     </refsynopsisdiv>
11     <refsection>
12         <title>Arguments</title>
13         <variablelist>
14             <varlistentry>
15                 <term>names</term>
16                 <listitem>
17                     <para>a vector of string with names of variables</para>
18                 </listitem>
19             </varlistentry>
20         </variablelist>
21     </refsection>
22     <refsection>
23         <title>Description</title>
24         <para>
25                         Returns names of named variables passed to current function but that are not in the function prototype.
26         </para>
27     </refsection>
28     <refsection>
29         <title>Examples</title>
30         <programlisting role="example"><![CDATA[
31 function foo(a,b)
32     x = checkNamedArguments();
33         disp(x, "Named Variable:");
34 endfunction
35
36 //No additional named variable
37 foo(1);
38 foo(1, 2);
39 foo(a = 1, b = 2);
40 foo(b = 2, a = 2);
41
42 //With additional named variables
43 foo(a = 1, c = 2);
44 foo(c = 2, b = 2); ]]>
45                 </programlisting>
46     </refsection>
47     <refsection role="see also">
48         <title>See also</title>
49         <simplelist type="inline">
50             <member>
51                 <link linkend="who">who</link>
52             </member>
53         </simplelist>
54     </refsection>
55 </refentry>