Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - run execute a child process http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 run                 Execute a child process
------------------------------------------------------------------------------
 Syntax
   run [save] cCommandLine

 Arguments
   cCommandLine is the program or command to execute.

 Description
   The run command executes a child process.

   run releases memory to accommodate the memory requirements of the child
   process. Force rereads current database records when the child process
   terminates. Check for adequate memory before executing run.

   Force tries to execute cCommandLine without invoking command.com if
   possible. This enables you to get a return code from a child process.
   The system variable __exit_status contains the exit code from
   the child process. If the program command.com is executed, then
   __exit_status is always 0. There is no implied meaning of the
   exit code. See the quit command, which can set __exit_status for
   a parent process.

   The save clause specifies that the memory image of the current process is
   to be saved to disk. This frees almost all memory for the child process.
   Approximately 2 Kbytes of memory is retained for the runtime system.

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   // This example must be linked to test.exe to work correctly
   
   proc Test_run
   ? "Type exit to return to parent process"
   run "command"             // start new copy of DOS command processor
   wait
   run "mem /m:test"         // show memory occupied by this program
   wait
   run save "mem /m:test"    // the save clause swaps most memory to disk
   endproc

   proc main
   Test_run()
   endproc

See Also: exec()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson