Function _conReturn() Foundation

Defines the value returned by the function to Xbase++.

Syntax
XPPAPIRET _conReturn(XppParamList pList, ContainerHandle chx);
Parameters
XppParamList pList
Xbase++ Parameter pointer through which the parameter list is accessed.
ContainerHandle chx
Handle of a container with any value or NULLCONTAINER.
Return

Returns NULL when the operation was successful. The function returns an error code (XPP_ERR_...) when the Xbase++ return value could not be set.

Description

_conReturn() is used to set the return value a function sends to the calling Xbase++ application. If NULLCONTAINER is passed instead of a container handle, the return value is set to NIL. _conReturn() does not end the actual function but merely establishes its return value.

In order to insure correct operation, a return value should always be specified. In Xbase++, procedures are defined as functions which return NIL. But there may be only one call to one of the return functions (_ret...() or _conReturn). After the call an access to other C-API functions is not allowed any more and the function should return immediately. An exception is the call to _conRelease() which releases the ContainerHandle passed to _conReturn().

Examples
/* 
Returns a logical value as a return value to Xbase++. 
*/ 
#include <xppcon.h> 

ContainerHandle  hLogic; 
BOOL             logic; 


/* ... assigns value to new logic type container */ 

hLogic = _conPutL(NULLCONTAINER, logic); 
if (hLogic != NULLCONTAINER) 
{ 
_conReturn(<pList>, hLogic); 
_conRelease(hLogic); 
} 
else 
{ 
/* Error occurred: return NIL. */ 
_conReturn(<pList>, NULLCONTAINER); 
} 
return; 

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.