add more help pages related to CAPI - check parameters - optional parameters
[scilab.git] / scilab / modules / core / help / en_US / capi / CheckLength.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry version="5.0-subset Scilab" xml:id="CheckLength" xml:lang="en"
3           xmlns="http://docbook.org/ns/docbook"
4           xmlns:xlink="http://www.w3.org/1999/xlink"
5           xmlns:svg="http://www.w3.org/2000/svg"
6           xmlns:mml="http://www.w3.org/1998/Math/MathML"
7           xmlns:html="http://www.w3.org/1999/xhtml"
8           xmlns:db="http://docbook.org/ns/docbook">
9   <refnamediv>
10     <refname>CheckLength</refname>
11
12     <refpurpose>C interface function which checks the length of a vector send
13     as a parameter to the C function</refpurpose>
14   </refnamediv>
15
16   <refsynopsisdiv>
17     <title>Calling Sequence</title>
18
19     <synopsis>CheckLength(StackPos,m_var,m_required)</synopsis>
20   </refsynopsisdiv>
21
22   <refsection>
23     <title>Parameters</title>
24
25     <variablelist>
26       <varlistentry>
27         <term>StackPos</term>
28
29         <listitem>
30           <para>the position on the stack of the variable for we want to check
31           (input parameter)</para>
32         </listitem>
33       </varlistentry>
34
35       <varlistentry>
36         <term>m_var</term>
37
38         <listitem>
39           <para>the number of lines of the parameter at position StackPos on
40           the stack (input parameter)</para>
41         </listitem>
42       </varlistentry>
43
44       <varlistentry>
45         <term>m_required</term>
46
47         <listitem>
48           <para>the required number of lines (input parameter)</para>
49         </listitem>
50       </varlistentry>
51     </variablelist>
52   </refsection>
53
54   <refsection>
55     <title>Description</title>
56
57     <para>C interface function which checks the length of a vector send as a
58     parameter to the C function. You must include stack-c.h to benefit from
59     this function. If the test fails, we return from the C interface and an
60     adequate error message is printed in the Scilab console.</para>
61   </refsection>
62
63   <refsection>
64     <title>Examples</title>
65
66     <programlisting role="example"> 
67 #include &lt;stack-c.h&gt;
68
69 int sci_check_properties(char * fname)
70 {
71   int m1, n1, l1;
72
73   CheckRhs(1,1);
74
75   GetRhsVar(1, "d", &amp;m1, &amp;n1, &amp;l1);
76
77   CheckLength(1,m1*n1,4); // Check that vector has 4 elements
78
79   return 0;
80 }
81  </programlisting>
82   </refsection>
83
84   <refsection>
85     <title>See Also</title>
86
87     <simplelist type="inline">
88       <member><link linkend="CheckColumn">CheckColumn</link></member>
89       <member><link linkend="CheckDims">CheckDims</link></member>
90       <member><link linkend="CheckRow">CheckRow</link></member>
91       <member><link linkend="CheckScalar">CheckScalar</link></member>
92       <member><link linkend="CheckVector">CheckVector</link></member>
93       <member><link linkend="OverLoad">CheckOverLoad</link></member>
94       <member><link linkend="CheckDimProp">CheckDimProp</link></member>
95       <member><link linkend="CheckSameDims">CheckSameDims</link></member>
96       <member><link linkend="CheckSquare">CheckSquare</link></member>
97       <member><link linkend="How to check parameters">HowToCheckParameters</link></member>
98     </simplelist>
99   </refsection>
100 </refentry>