Function _parclen() Foundation

Determines the length of a character string parameter.

Syntax
ULONG _parclen(XppParamList pList, ULONG ulIndex, ...);
Parameters
XppParamList pList
Pointer to the Xbase++ parameter list, which is used to provide access to the parameter.
ULONG ulIndex
Position of the parameter which has the character string (first parameter is 1).
...
The remaining arguments must be of ULONG type and are only considered when the parameter <ulIndex> is an array. In this case, an index is specified for each array dimension in order to specify the element which has the character string. Note:The end of the array index list must be indicated by incorporating a NULL as the last value in the list.
Return

Returns the length of the character string. Character strings of NULL length are possible. When the parameter or the indexed array element is not a character string, NULL is also returned.

Description

_parclen() determines the length of a character string which was passed as a parameter from Xbase++. NULL characters within the character string are also counted. However, the terminating NULL character is not counted. A buffer allocated for parc() should be one character longer than the length returned from _parclen().

Examples
/* 
Determines the length of a character string. 
*/ 
#include <xpppar.h> 

LONG   len; 
                             /* Is second parameter 2 a string ? */ 
if ( XPP_IS_CHAR( _partype(<pList>, 2) ) ) 
{ 
len = _parclen(<pList>, 2);  /* determines the length */ 
} 
else 
len = -1;                    /* error: store illegal length */ 

Feedback

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.