start Function

Top  Previous  Next

 

Syntax

System.Process.start(file [, argArray])

System.Process.start(file [, name, arg [, name, arg [, ...]]])

Arguments

fileAn instance File object of the CellScript file to run.
argArrayAn optional array of names and values for arguments.
nameAn optional string argument name.
argAn optional argument value.

Return Value

If successful, an integer process ID that can be used with the kill function; otherwise -1;

Remarks

If arguments are passed to the script, they appear in the script as initialized variables. If argArray is used to pass arguments, the elements of array are assumed to be in pairs where the first element is a string that is the name of the argument, and the next element is the value to assign.

 

This function fails if the maximum number of scripts is already running.

Examples

f = File.open("Launch.ecs");

if (typeof f == "object")

 System.Process.start(f, "ValStr", "arg value", "ValAry", [1, 5.2, "test"]);

// This is equivalent

args = ["ValStr", "arg value", "ValAry", [1, 5.2, "test"]];

System.Process.start(f, args);

See Also