JavaScript Editor js editor     Web development 



Main Page

Sets the library return value to a logical value.

void _RetLogical(int flag)
int flag;                     /* Flag. */

Remarks

_RetLogical(В ) considers zero to be False, and any non-zero value to be True.

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 is a coin flip. It returns .T. or .F. based on the library function RAND(В ).

Visual FoxPro Code

В Copy Code
SET LIBRARY TO RETLOGIC
? RETLOGICAL()  && returns .T. or .F. pseudo-randomly

C Code

В Copy Code
#include <pro_ext.h>

FAR Example(ParamBlk FAR *parm)
{
   _RetLogical(rand() % 2);
}

FoxInfo myFoxInfo[] = {
   {"RETLOGICAL", (FPFI) Example, 0, ""},
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

See Also



JavaScript Editor js editor     Web development