Function _conSizeC() Foundation

Determines the number of characters in a string container.

Syntax
XPPAPIRET _conSizeC(ContainerHandle chs, ULONG *ulSize);
Parameters
ContainerHandle chs
Handle of a container of string character type.
ULONG *ulSize
Pointer to a ULONG buffer into which the length of the character string of the container is written.
Return

The function returns an error code (XPP_ERR_...) when the container is not of character type. Otherwise the return value is NULL and the length is placed in *ulSize.

Description

Using _conSizeC() the length of the character string of a container of character or memo type can be determined.

Since this function returns an error when the passed container does not contain a character string, it is not necessary to test its type before the call of _conSizeC().

Examples
/* 
Determines the length of a character string. 
*/ 

#include <xppcon.h> 

ContainerHandle chs; 
BOOL            isRef; 
XPPAPIRET       xr; 
ULONG           sSize; 

chs = _conParam(<pList>, 1, &isRef); 
xr = _conSizeC(chs, &sSize); 
if (xr != 0) 
{ 
/* 
   ... error: parameter 1 is not a string or no parameters were 
   passed. 
*/ 
} 
else 
{ 
/* 
   ... Parameter 1 is a string and *sSize contains the length of 
   the string 
*/ 
} 
/* 
release the parameter container 
(if not passed by reference) 
*/ 
if (!isRef) 
_conRelease(chs); 

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.