Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Português - 日本語

Please note that the recommended version of Scilab is 6.0.0. This page might be outdated.
See the recommended documentation of this function

Aide Scilab >> API Scilab > Scilab Gateway API > CheckRhs

CheckRhs

C macro which checks the number of input arguments present in the calling Scilab function.

Calling Sequence

CheckRhs(nb_min_params,nb_max_params)

Arguments

nb_min_params

The minimum number of input arguments which must be present in the calling Scilab function

nb_max_params

the maximum number of input arguments which must be present in the calling Scilab function

Description

C macro which checks the number of input arguments present in the calling Scilab function. You must include stack-c.h to benefit from this function.

If the number of input arguments is not between nb_min_params and nb_max_params, we quit the C interface (return 0;) and an error is returned in the Scilab console.

Since CheckRhs is doing a return 0; within the gateway function, it is important to call this macro before any memory allocation in order to avoid any memory leak.

WARNING: This API is deprecated from Scilab 5.2.0 and is going to be removed with Scilab 6.0. Please use API Scilab (the new Scilab API).

Examples

In this example, the C gateway function checks for a number of input arguments which must be between 2 and 3.

#include <stack-c.h>

int sci_mycheckrhs(char * fname)
{
  CheckRhs(2,3);

  return 0;
}

Now, some functions testing this interface:

mycheckrhs(A,B); // OK, 2 output arguments
mycheckrhs(A,B,C); // OK, 3 output arguments
mycheckrhs(A); // ERROR, 1 output argument
mycheckrhs(A,B,C,D); // ERROR, 4 output arguments

See Also

  • CheckLhs — C macro which checks the number of output arguments present in the calling Scilab function.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Oct 05 12:11:04 CEST 2011