Difference between revisions of "Retc()"
From Lianjapedia
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) m (Text replace - "lianjaapi.h" to "lianja_api.h") |
||
Line 7: | Line 7: | ||
==SYNOPSIS== | ==SYNOPSIS== | ||
<code lang="c"> | <code lang="c"> | ||
− | #include " | + | #include "lianja_api.h" |
int _retc(string) | int _retc(string) | ||
Line 33: | Line 33: | ||
<code lang="c"> | <code lang="c"> | ||
− | #include " | + | #include "lianja_api.h" |
lianjaapi_ltow() | lianjaapi_ltow() |
Latest revision as of 08:59, 11 April 2013
PURPOSE
Return a character string
SYNONYM
api_ret_c()
SYNOPSIS
#include "lianja_api.h" int _retc(string) <input parameters> char *string; /* Address of a buffer containing a character string */ <output parameters> none
DESCRIPTION
The _retc() function is used to return a character string. The maximum length of a string that can be returned is 64kB. If the string is too long, an error message will be returned.
EXAMPLE
The following example evaluates the first parameter passed and returns the English translation of the logical condition.
Example Lianja script:
m_word=ltow(.T.)
Example 'C' function:
#include "lianja_api.h" lianjaapi_ltow() { char strbuff[6]; if ( _parinfo(1) == API_LTYPE ) { if ( _parl(1) == 0 ) { strcpy( strbuff, "False" ); } else { strcpy( strbuff, "True" ); } }else { strcpy(strbuff, ""); } _retc( strbuff ); }
SEE ALSO
_parc(), _parclen(), _parcsiz(), _parinfo(), _retclen(), ISCHAR(), CHAR_ALLTRIM(), CHAR_LOWER(), CHAR_LPAD(), CHAR_LTRIM(), CHAR_RPAD(), CHAR_RTRIM(), CHAR_STR(), CHAR_UPPER(), DATE_STOD()