_Evaluate( ) API Library Routine

See Also   Example

Compiles and executes a Visual FoxPro expression you specify with expr, placing the result in res.

Syntax

int _Evaluate(Value FAR *res, char FAR *expr)
Value FAR *res;            /* Address for result. */
char FAR *expr;            /* Expression. */

Remarks

You can specify any expression that can be evaluated by the Visual FoxPro EVALUATE( ) function. After the expression is evaluated, control usually returns to the C statement immediately following the call to _Evaluate( ). Exceptions include evaluating a Visual FoxPro expression that carries out a Visual FoxPro CANCEL or QUIT command.

_Evaluate( ) returns the Visual FoxPro internal error number for any errors that occur during evaluation of the Visual FoxPro expression, or returns 0 if no errors occur. The contents of res are valid only when _Evaluate( ) returns a value of 0.

Note   Do not call _Evaluate( ) from an event handler.

For more information on how to create an API library and integrate it with Visual FoxPro, see Chapter 28, Accessing the Visual FoxPro API, in the Programmer's Guide.