_RetChar( ) API Library Routine

Sets the library return value to a null-terminated string.

void _RetChar(char FAR *string)
char FAR *string;            /* String. */

Remarks

If you need to return a string that might contain embedded null characters, use the _RetVal( ) function.

For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.

Example

The following example makes two calls to _RetChar( ), demonstrating that control returns to the API routine from _RetChar( ) and that the last _RetChar( ) determines the value returned to Visual FoxPro.

Visual FoxPro Code

SET LIBRARY TO RETCHAR

C Code

#include <pro_ext.h>

void FAR chars(ParamBlk FAR *parm)
{
   char message[] = "Hello, world";
   _RetChar(message);
}
FoxInfo myFoxInfo[] = {
   {"CHARS", (FPFI) chars, 0, ""}
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

See Also

_RetCurrency( ) API Library Routine | _RetDateStr( ) API Library Routine | _RetDateTimeStr( ) API Library Routine | _RetFloat( ) API Library Routine | _RetInt( ) | _RetLogical( ) API Library Routine | _RetVal( ) API Library Routine