$process.waitFor

Waits until either the specified or the last created process exits.
Syntax
    $process.waitFor
Documentation$process.waitFor: This function gives you the ability to join the current process to the child process to wait until it exits. If the process was already exited before this function was called it immediately returns. Be careful to give the process a chance to flush it's stderr and stdout buffers doing a getStderr and a getStdout first or you might end up in a blocking situation.

    Paramter:
      1 - PID of process to wait for (optional)
    Returns:
      void
    Throws:
      java.lang.NumberFormatException, java.lang.IllegalArgumentException if the PID is malformed or not existing.
Examples
$process.fork{wget --help} $process.setInputEOF{} Stdout:
$process.getStdout{}

Stderr:
$process.getStderr{}

$process.waitFor{} Exitvalue: $process.getExitValue{}
GroupSpecial
Minimum required transaction-mode:NONE
Required scripting permission of the developerPERMISSION_FL_EXPERT
Minimum parameters1
Maximum parameters 1