FOXDOCMD( ) Function

Runs a Visual FoxPro command from an application that allows API calls.

nSuccess = FOXDOCMD(cFoxCommand, cOptions)

Return Values

Integer

Parameters

  • cFoxCommand
    Specifies the Visual FoxPro command to run.
  • cOptions
    One or more of the following.
    Setting Description
      (Blank) Runs the specified command without activating the main Visual FoxPro window.
    a Activates the main Visual FoxPro window and runs the specified command.
    i If Visual FoxPro is not running, activates Visual FoxPro without making the Visual FoxPro window visible.
    t If another program is already running in Visual FoxPro, displays an error message rather than executing cFoxCommand.

Remarks

Returns 0 if the Visual FoxPro command is successfully executed; -1 otherwise.

If Visual FoxPro is already running, FOXDOCMD( ) sends the command to Visual FoxPro. If Visual FoxPro is not already running, FOXDOCMD( ) runs Visual FoxPro and sends the command.

Example

*In Visual FoxPro
DECLARE integer FOXDOCMD in "FPOLE.DLL" string,string
=FOXDOCMD("SELECT * FROM customer","at")

See Also

Fpole.dll | Fpole.dll Examples | FOXEVAL( ) | SETERRMODE( ) Function | SETOLEOBJECT( ) Function | CLOSEIT( ) | GETLASTERR( )