Retclen()

From Recital Documentation Wiki
Revision as of 12:34, 30 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PURPOSE

Pass a character string to Recital


SYNONYM

api_ret_clen()


SYNOPSIS

#include "dbapi.h"
 
int	_retclen(string, len)
 
<input parameters>
char	*string;		/*Address of a buffer containing a character string 	*/
int	len;			/* Length of string						*/
 
<output parameters>
none


DESCRIPTION

The _retclen() function is used to pass a character pointer back to your application. The second parameter, len, is used to specify the length of the character string returned. The maximum length of a string that can be returned to Recital is 8192. If the string is too long, Recital will return an error message.


EXAMPLE

The following example evaluates the first parameter passed and returns the English translation of the logical condition with a length of 5 characters.

Example Recital program:

m_word=ltow(.T.)

Example 'C' function:

#include "dbapi.h"
 
dbapi_ltow()
{
    char	strbuff[6];
 
    if (_parinfo(1) == API_LTYPE) {
       if ( _parl(1) == 0 ) {
       strcpy( strbuff, "False" );
       } else {
       strcpy( strbuff, "True" );
       }
    }else {
       strcpy(strbuff, "");
    }
 
    _retclen(strbuff, 5);
}


SEE ALSO

_parc(), _parclen(), _parcsiz(), _parinfo(), _retc(), ISCHAR(), CHAR_ALLTRIM(), CHAR_LOWER(), CHAR_LPAD(), CHAR_LTRIM(), CHAR_RPAD(), CHAR_RTRIM(), CHAR_STR(), CHAR_UPPER(), DATE_STOD()