Parni()

From Recital Documentation Wiki
Jump to: navigation, search

PURPOSE

Convert a Recital numeric to an integer


SYNONYM

api_par_ni()


SYNOPSIS

#include "dbapi.h"
 
int	_parni(order [,index]))
 
<input parameters>
int	order;		/* Placement in actual parameter list	*/
int	index;		/* Array element index			*/
 
<output parameters>
none


DESCRIPTION

The _parni() function returns a numeric parameter passed from Recital as an integer. The order specifies the actual placement in the parameter list. If the parameter passed is an array, then the optional index value is used to specify the required element number.


EXAMPLE

The following example converts a Recital numeric value passed as the first parameter to an integer.

Example Recital program:

m_int=1252
m_double =conint(m_int)
return

Example 'C' function:

#include "dbapi.h"
 
dbapi_conint()
{
    int	value;
 
    if (_parinfo(1) == API_NTYPE) {
       value = _parni(1);
    }else {
       value = 0;
    }
 
    _retni( value );
}


SEE ALSO

_parinfa(), _parinfo(), _parnd(), _parnl(), retnd(), _retni(), _retnl(), ISNUM()