Function _conGetCL() Foundation

Copies the value of a string container into a buffer.

Syntax
XPPAPIRET _conGetCL(ContainerHandle chs, ULONG *ulCopy,
                     CHAR *pcBuffer, ULONG ulSize);
Parameters
ContainerHandle chs
Handle of a container of character string type.
ULONG *ulCopy
Pointer to a ULONG. After the call, this contains the number of characters which were copied into the buffer.
CHAR *pcBuffer
Pointer to the buffer into which the character string is to be copied. Note:In Xbase++ character strings may contain NULL characters. However no NULL character is written at the end of the character string.
ULONG ulSize
Length of the passed buffer. The resulting character string contains a maximum of ulSize characters.
Return

The function returns an error code (XPP_ERR_...) when the container chs is not a character string. If the return value is NULL, the operation was successful.

Description

The function copies a container of character string type into a buffer. The copied string can contain NULL characters, however no NULL character is automatically written at the end of the copied character string.

Examples
/* 
Copies the first 10 characters of a character string and then 
terminates with a NULL character. 
*/ 
#include <xppcon.h> 

ContainerHandle  hString; 
XPPAPIRET        xr; 
CHAR             buffer[11]; 
ULONG            resultLen; 


/* Assigns a value to... hString */ 
xr = _conGetCL(hString, &resultLen, buffer, sizeof(buffer)-1); 
if (xr == 0) 
{ 
/* Terminate with NULL character */ 
buffer[resultLen] = '\0'; 
/* ... Operations with the buffer */ 
} 

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.