Function _conPutEmptyData() Foundation

Store the default null value of the passed datatype to its container.

Syntax
ContainerHandle _conPutEmptyData(ContainerHandle chDest,
                              ULONG xppType,
                              LONG length,
                              LONG decs);
Parameters
ContainerHandle chDest
Handle of a container that will contain the null value. If NULLCONTAINER is passed, a new container will be created.
ULONG xppType
Xbase++ datatype of the null value. Datatypes are defined in types.ch.
LONG length
In case the Xbase++ datatype is a memo field or a character string, this parameter is used to determine the length of the empty string that shall be created.
LONG decs
If the specified Xbase++ datatype is a numeric type, this parameter is used to determine the amount of decimals of the empty value.
Return

This function returns a container containing the new value.

Description

The function _conPutEmptyData() is used to assign a default null value of a certain Xbase++ datatype to a container. If a null value for the Xbase++ datatypes "C" or "M" is to be created, the resulting container will contain an empty string of a specified length. Logical values will default to .F. (FALSE). The date datatype will be emptied, and numeric values will default to zero.

Examples
#include <windows.h> 

#include "xppdef.h" 
#include "xpppar.h" 
#include "xppcon.h" 

XPPRET XPPENTRY MyCAPIFunction(XppParamList paramList) 
{  /* Declare and initialize variables */ 
ContainerHandle chTemp; 
ContainerHandle chResult = _conNewArray( 1, 4 ); 

/* Create NULL values.*/ 
chTemp = _conPutEmptyData( NULLCONTAINER, XPP_CHARACTER, 10, 0 ); 
if(_conArrayPut( chResult, chTemp, 1, 0 )) 
{ /* Error handling... */ 
} 

chTemp = _conPutEmptyData( chTemp, XPP_LOGICAL, 0, 0 ); 
if(_conArrayPut( chResult, chTemp, 2, 0 )) 
{ /* Error handling... */ 
} 

chTemp = _conPutEmptyData( chTemp, XPP_DATE, 0, 0 ); 
if(_conArrayPut( chResult, chTemp, 3, 0 )) 
{ /* Error handling... */ 
} 

chTemp = _conPutEmptyData( chTemp, XPP_NUMERIC, 10, 0 ); 
if(_conArrayPut( chResult, chTemp, 4, 0 )) 
{ /* Error handling... */ 
} 

/* Return created array. */ 
_conReturn( paramList, chResult ); 

/* Release containers. */ 
_conRelease( chTemp ); 
_conRelease( chResult ); 
} 


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.