Launch

angerangel edited this page Jan 4, 2013 · 1 revision
Clone this wiki locally

USAGE

   LAUNCH script /args arg /wait

DESCRIPTION

Runs a script as a separate process; return immediately.

LAUNCH is a function value.

ARGUMENTS

  • script -- The name of the script (file! string! none!)

REFINEMENTS

  • /args
    • arg -- Arguments to the script (string! block! none!)
  • /wait -- Wait for the process to terminate

#SOURCE

launch: make function! [  [
    {Runs a script as a separate process; return immediately.}
    script [file! string! none!] "The name of the script"
    /args arg [string! block! none!] "Arguments to the script"
    /wait "Wait for the process to terminate"
    /local exe
][
    if file? script [script: to-local-file clean-path script]
    exe: to-local-file system/options/boot
    args: to-string reduce [{"} exe {" "} script {" }]
    if arg [append args arg]
    either wait [call/wait args] [call args]
] ]