- Scilab Help
- API Scilab
- legacy
- Low level functions
- AssignOutputVariable
- CallOverloadFunction
- CheckInputArgument
- CheckOutputArgument
- ReturnArguments
- UpdateStack
- Boolean reading (Scilab gateway)
- Boolean writing (Scilab gateway)
- Boolean sparse reading (Scilab gateway)
- Boolean sparse writing (Scilab gateway)
- Check variable dimensions (Scilab gateway)
- Variable Reference (Scilab gateway)
- Variable dimension (Scilab gateway)
- Variable Type (Scilab gateway)
- Variable Complexity (Scilab gateway)
- Matrix Type (Scilab gateway)
- deleteNamedVariable
- Double reading (Scilab gateway)
- Double writing (Scilab gateway)
- getNbInputArgument (Scilab gateway)
- getNbOutputArgument (Scilab gateway)
- Handle reading (Scilab gateway)
- Handle writing (Scilab gateway)
- Integer Precision (Scilab gateway)
- Integer reading (Scilab gateway)
- Integer writing (Scilab gateway)
- nbInputArgument (Scilab gateway)
- Pointer reading (Scilab gateway)
- Pointer writing (Scilab gateway)
- Polynomial Symbolic Variable (Scilab gateway)
- Polynomial reading (Scilab gateway)
- Polynomial writing (Scilab gateway)
- Sparse matrix reading (Scilab gateway)
- Sparse writing (Scilab gateway)
- String reading (Scilab gateway)
- String writing (Scilab gateway)
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
However, this page did not exist in the previous stable version.
CheckOutputArgument
C function which checks the number of output arguments present in the calling Scilab function.
Syntax
CheckOutputArgument(void* _pvCtx, int iMin, int iMax)
Arguments
- pvApiCtx
Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h
- iMin
the minimum number of output arguments which must be present in the calling Scilab function
- iMax
the maximum number of output arguments which must be present in the calling Scilab function
Description
C function which checks the number of output arguments present in the calling Scilab function. You must include api_scilab.h to benefit from this function.
If the number of arguments is not between _iMin and
_iMax, we quit the C interface (return 0;
) and
an error is returned in the Scilab console.
Since CheckOutputArgument
is doing a return
0;
within the gateway function, it is important to call this
function before any memory allocation in order to avoid any memory
leak.
This function replaces the deprecated CheckLhs
function
Examples
In this example, the C gateway function checks for a number of output arguments which must be between 2 and 3.
#include <api_scilab.h> int sci_mychecklhs(char * fname) { CheckOutputArgument(pvApiCtx, 2, 3); // Read input argument // Perform some operations // Return output argument return 0; }
Now, some functions testing this interface:
[A,B] = mychecklhs(); // OK, 2 output arguments [A,B,C] = mychecklhs(); // OK, 3 output arguments [A] = mychecklhs(); // ERROR, 1 output argument [A,B,C,D] = mychecklhs(); // ERROR, 4 output arguments
See also
- CheckInputArgument — C function which checks the number of input arguments present in the calling Scilab function.
Report an issue | ||
<< CheckInputArgument | Low level functions | ReturnArguments >> |