Runs a program using the current process
Source position: amigados.pas line 1702
function RunCommand( |
seg: LongInt; |
stack: LongInt; |
const paramptr: pCHAR; |
paramlen: LongInt |
):LongInt; |
seg: LongInt; |
stack: LongInt; |
const paramptr: string; |
paramlen: LongInt |
):LongInt; |
Return code from executed command. -1 indicates failure
Runs a command on your process/cli. Seg may be any language, including BCPL programs. Stack is in bytes. paramptr is a null- terminated string, paramlen is its length. Returns the returncode the program exited. Returns -1 if the stack couldn't be allocated.
NOTE: the argument string must be terminated with a newline to work properly with ReadArgs() and other argument parsers.
RunCommand also takes care of setting up the current input filehandle in such a way that ReadArgs() can be used in the program, and restores the state of the buffering before returning. It also sets the value returned by GetArgStr(), and restores it before returning.
It's usually appropriate to set the command name (via SetProgramName()) before calling RunCommand(). RunCommand() sets the value returned by GetArgStr() while the command is running.
|
Create a new process from taglist |
|
|
Have a shell execute a command line |
|
|
Execute a CLI command |
|
|
Returns the arguments for the process |
|
|
Sets the name of the program being run |
|
|
Read bytes of data from a file |