Difference between revisions of "Parni()"
From Lianjapedia
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) m (Text replace - "lianjaapi.h" to "lianja_api.h") |
||
Line 7: | Line 7: | ||
==SYNOPSIS== | ==SYNOPSIS== | ||
<code lang="c"> | <code lang="c"> | ||
− | #include " | + | #include "lianja_api.h" |
int _parni(order [,index])) | int _parni(order [,index])) | ||
Line 36: | Line 36: | ||
<code lang="c"> | <code lang="c"> | ||
− | #include " | + | #include "lianja_api.h" |
lianjaapi_conint() | lianjaapi_conint() |
Latest revision as of 08:57, 11 April 2013
PURPOSE
Convert a numeric to an integer
SYNONYM
api_par_ni()
SYNOPSIS
#include "lianja_api.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 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 numeric value passed as the first parameter to an integer.
Example Lianja script:
m_int=1252 m_double =conint(m_int) return
Example 'C' function:
#include "lianja_api.h" lianjaapi_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()