_Execute( ) API Library Routine

See Also   Example

Compiles and executes the null-terminated statement you specify in stmt.

Syntax

int _Execute(char FAR *stmt)
char FAR *stmt;            /* Statement to execute. */

Remarks

The stmt parameter can be any command or function that can be executed from the Command window. When execution of the statement is complete, control normally returns to the C statement immediately following the call to _Execute( ). Exceptions include executing code that performs a Visual FoxPro CANCEL or QUIT command.

_Execute( ) returns the Visual FoxPro internal error number for any error that occurs during execution of the statement, or 0 if no error occurs.

Note   Do not call _Execute( ) 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.