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 }; |