Name

CheckLength — C interface function which checks the length of a vector send as a parameter to the C function

Calling Sequence

CheckLength(StackPos,m_var,m_required)

Parameters

StackPos

the position in the Scilab memory of the parameter for which we want to check (input parameter)

m_var

the number of lines of the parameter at position StackPos in the Scilab memory (input parameter)

m_required

the required number of lines (input parameter)

Description

C interface function which checks the length of a vector send as a parameter to the C function. You must include stack-c.h to benefit from this function. If the test fails, we return from the C interface and an adequate error message is printed in the Scilab console.

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

 
#include <stack-c.h>

int sci_check_properties(char * fname)
{
  int m1, n1, l1;

  CheckRhs(1,1);

  GetRhsVar(1, "d", &m1, &n1, &l1);

  CheckLength(1,m1*n1,4); // Check that vector has 4 elements

  return 0;
}
 

See Also

CheckColumn, CheckDims, CheckRow, CheckScalar, CheckVector, CheckOverLoad, CheckDimProp, CheckSameDims, CheckSquare, How to check parameters