1
1
<?xml version="1.0" encoding="UTF-8"?>
2
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:html="http://www.w3.org/1999/xhtml" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="CheckInputArgument" xml:lang="en">
4
<refname>CheckInputArgument</refname>
6
C function which checks the number of input arguments present in
7
the calling Scilab function.
11
<title>Calling Sequence</title>
12
<synopsis>CheckInputArgument(void* pvCtx, int iMin, int iMax)</synopsis>
15
<title>Arguments</title>
21
Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h
29
the minimum number of input arguments which must be present
30
in the calling Scilab function
38
the maximum number of input arguments which must be present
39
in the calling Scilab function
46
<title>Description</title>
48
C function which checks the number of input arguments present in the
49
calling Scilab function. You must include api_scilab.h to benefit from this
53
If the number of arguments is not between _iMin and
54
_iMax, we quit the C interface (<literal>return 0;</literal>) and
55
an error is returned in the Scilab console.
58
Since <literal>CheckInputArgument</literal> is doing a <literal>
62
within the gateway function, it is important to call this
63
function before any memory allocation in order to avoid any memory
67
This function replaces the deprecated <literal>CheckLhs</literal> function
71
<title>Examples</title>
73
In this example, the C gateway function checks for a number of
74
input arguments which must be between 2 and 3.
76
<programlisting role="example"><![CDATA[
4
<refname>CheckInputArgument</refname>
6
C function which checks the number of input arguments present in
7
the calling Scilab function.
11
<title>Calling Sequence</title>
12
<synopsis>CheckInputArgument(void* pvCtx, int iMin, int iMax)</synopsis>
15
<title>Arguments</title>
21
Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h
29
the minimum number of input arguments which must be present
30
in the calling Scilab function
38
the maximum number of input arguments which must be present
39
in the calling Scilab function
46
<title>Description</title>
48
C function which checks the number of input arguments present in the
49
calling Scilab function. You must include api_scilab.h to benefit from this
53
If the number of arguments is not between _iMin and
54
_iMax, we quit the C interface (<literal>return 0;</literal>) and
55
an error is returned in the Scilab console.
58
Since <literal>CheckInputArgument</literal> is doing a <literal>
62
within the gateway function, it is important to call this
63
function before any memory allocation in order to avoid any memory
67
This function replaces the deprecated <literal>CheckLhs</literal> function
71
<title>Examples</title>
73
In this example, the C gateway function checks for a number of
74
input arguments which must be between 2 and 3.
76
<programlisting role="example"><![CDATA[
77
77
#include <api_scilab.h>
79
79
int sci_mycheckrhs(char * fname)
91
91
]]></programlisting>
92
<para>Now, some functions testing this interface:</para>
93
<programlisting role="example"><![CDATA[
92
<para>Now, some functions testing this interface:</para>
93
<programlisting role="example"><![CDATA[
94
94
mycheckrhs(A,B); // OK, 2 input arguments
95
95
mycheckrhs(A,B,C); // OK, 3 input arguments
96
96
mycheckrhs(A); // ERROR, 1 input argument
97
97
mycheckrhs(A,B,C,D); // ERROR, 4 input arguments]]></programlisting>
99
<refsection role="see also">
100
<title>See Also</title>
101
<simplelist type="inline">
103
<link linkend="CheckOutputArgument">CheckOutputArgument</link>
99
<refsection role="see also">
100
<title>See Also</title>
101
<simplelist type="inline">
103
<link linkend="CheckOutputArgument">CheckOutputArgument</link>