num-var = SPF_Exec([{SYNC|ASYNC},][{HIDDEN|NORMAL},]cmd-str [,cmd-str] ...)


Operands:

SYNC  |

ASYNC

This optional operand indicates how you want the command to run. If SYNC is coded, control will not be returned to the macro until the command is complete. If ASYNC is coded, the command will be issued and control immediately returned to the macro.



HIDDEN  |

NORMAL

This optional operand indicates whether you want the command to run in a visible window or not. If HIDDEN is coded, no window will be seen. (And if errors occur, they will not be visible either)  If NORMAL is coded, the command will run in a normally visible command window.



cmd-str

the command you wish executed. When multiple strings are provided as operands, they will be concatenated together with a single blank between the operands.


Returns:


RC will be set to the return code from the executed function. This value will also be returned in num-var. Msg$ will be set to "" (null).


Special Notes:


Both SYNC|ASYNC and HIDDEN|NORMAL are optional operands, and if omitted, SYNC, NORMAL will be assumed.


NOTE: If you want to specify the HIDDEN|NORMAL operand, you MUST specify the SYNC|ASYNC operand as well, it can not be omitted.


The cmd-str string expression is passed as a program to be executed. This operates similar to the SPF_Shell function, except that the command does not run under the command interpreter (CMD.EXE) but is executed directly. The usual issues about locating the program using the current working directory and the system PATH variable apply to calls to SPF_EXEC.


Invoking programs to run under CMD.EXE can require complicated quoting and double quoting of operands when things like filenames with embedded blanks are required. With SPF_Exec only simple quoting is required, making the building of the string expression for the command much simpler. The function SPF_Quote$ may be of assistance in creating properly quoted operand values.


Because such commands can perform powerful functions (such a deleting files), care should be taken to issue these commands correctly.

Created with the Personal Edition of HelpNDoc: Transform Your Documentation Workflow with HelpNDoc's Intuitive UI