Function _retc() Foundation

Returns a string as a character string to Xbase++.

Syntax
BOOL _retc(XppParamList pList, CHAR *cString);
Parameters
XppParamList pList
Pointer to the Xbase++ parameter list of the function whose return value is being set.
CHAR *cString
NULL terminated C string which is copied into the return container.
Return

If the string is copied successfully into the return container, the function returns TRUE. If the return value is FALSE, not enough memory is available for the string to be copied.

Description

_retc() is used to return a C string as a character string to Xbase++. The string is copied up to the first NULL character. Calling this function does not exit the actual function, but merely sets the return value. After the call an access to other C-API functions except for _conRelease()is not allowed anymore and the function should return immediately.

To insure correct operation, a return value has always to be set. In Xbase++, NIL should be returned for procedures, which are functions without return values.

Examples
/* 
Defines a string as a return value of a function (without exiting 
the function) 
*/ 
#include <xpppar.h> 

if (_retc(<pList>, "Default Return String") == FALSE) 
return; 

if ( XPP_IS_NUM( _partype(<pList>, 1) ) ) 
_retc(<pList>, "Numeric Value"); 

if ( XPP_IS_DATE( _partype(<pList>, 1) ) ) 
_retc(<pList>, "Date Value"); 

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.