Function _parnl() Foundation
Returns the integer value of a numeric parameter.
LONG _parnl(XppParamList pList, ULONG ulIndex, ...);
Returns the value of the numeric parameter as a LONG value. If the value is not an integer, it is rounded.
_parnl() is used to read a numeric value from a parameter.
The numeric type in Xbase++ can have values which can not be represented in a LONG. No check for 'overflow' takes place. The return value is undefined if the parameter's value is too large. For numeric type parameters, the function _partype() returns additional information as to whether the value has decimal places or is too large to be converted to a LONG.
/*
Reads a numeric value as LONG from a parameter.
*/
#include <xpppar.h>
LONG numLong;
LONG type;
type = _partype(<pList>, 5); /* determine the type of parameter 5 */
/* Is it numeric value and not double? */
if ( XPP_IS_NUM( type ) && ! XPP_IS_FLOAT( type) )
{
numLong = _parnl(<pList>, 5);
}
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.