Parnd()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Convert a numeric to a double

SYNONYM

api_par_nd()

SYNOPSIS

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

DESCRIPTION

The _parnd() function returns a numeric parameter as a double. 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 numeric value passed as the first parameter to a double.

Example Lianja script:

m_double=1252
m_double =condouble(m_double)
return

Example 'C' function:

#include "lianja_api.h"
 
lianjaapi_condouble()
{
    double	value;
 
    if ( _parinfo(1) == API_NTYPE ) {
       value = _parnd(1);
    }else {
       value = 0;
    }
 
    _retnd( value );
}

SEE ALSO

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