[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+-----+####################################################################
#+-| RUN |------------------------------------------+#########################
#| +-----+ The RUN command executes a child process |#########################
#+--------------------------------------------------+#########################
##############################################################################
##############################################################################
#+--| Syntax |------------------+#############################################
#| RUN [SAVE] [<C-exp>] |#############################################
#+------------------------------+#############################################
##############################################################################
##############################################################################
##########+---| Description |--------------------------------------+##########
##########| RUN releases memory to accommodate the child process. |##########
##########| FORCE rereads current database records when the child |##########
##########| process terminates. Check for adequate memory before |##########
##########| using RUN. |##########
##########| ------------------------------------------------------ |##########
##########| FORCE tries to execute <C-exp> without command.com if |##########
##########| possible. This enables you to get a return code from |##########
##########| a child process. The FORCE 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. |##########
##########| ------------------------------------------------------ |##########
##########| SAVE |##########
##########| |##########
##########| Specifies the memory image of the current process is |##########
##########| to be saved to the disk. This frees almost all memory |##########
##########| for the child process. Approximately 2k of memory is |##########
##########| retained for the runtime system. |##########
##########+--------------------------------------------------------+##########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Run the child process /c install.bat. |#########
#########| |#########
#########| RUN "C:\command.com /c install.bat" |#########
#########| RUN cmds[ k ] + ".exe" |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Run a program depending upon a pick list selection. |#########
#########| |#########
#########| VARDEF |#########
#########| CHAR(14) f[6] = "dd.exe","q1.exe","q2.exe"; |#########
#########| "backup.exe","z.com","r.com" |#########
#########| LONG k, choice |#########
#########| INT r |#########
#########| ENDDEF |#########
#########| |#########
#########| PROCEDURE force_main |#########
#########| k = pick_init() |#########
#########| FOR r = 0 TO 5 |#########
#########| pick_str( k, f[r] ) && put filenames |#########
#########| && into pick list |#########
#########| NEXT |#########
#########| |#########
#########| *--- allow user to select file |#########
#########| |#########
#########| pick_list( k,3,4,9,24,choice,.F.,.F.) |#########
#########| IF choice <> 0 |#########
#########| RUN f[ choice ] |#########
#########| ENDIF |#########
#########| ENDPRO |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 3 |-------------------------------------------+#########
#########| * RUN a child process, yet save the current |#########
#########| * program to disk to conserve memory. The disk |#########
#########| * file created is unique. The RUN SAVE command is |#########
#########| * safe in a network environment. |#########
#########| |#########
#########| RUN SAVE "mychild.exe" |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
CALL
DIR
ERASE
LOAD
QUIT
RENAME
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson