Documentation
IPS_RunScriptEx
boolean IPS_RunScriptEx (int $ScriptID, array $Parameter)
Parameters
ScriptID | Unique ID of the script |
Parameter | Key (string) => Value (variant) pair can be accessed in the newly executed script. |
Returns
If the command succeeds, it returns TRUE, otherwise FALSE.
Description
The command causes the start of the script with the ID ScriptID while passing the array parameter as the argument. The called script is running in parallel (simultaneously) to the calling script. Also here apply the hints described in IPS_RunScript.
Scripts that are executed via IPS_RunScript use the following System Variables .
The array Parameter can contain any number of "Key => Value" pairs (see PHP Arrays). Each pair appears in the called script as variable Key with its content Value.
Example
//Script, that will launch another script with parameter passing.
IPS_RunScriptEx(12345 /*[Temp]*/, Array("Title" => "Temp.", "Tmin" => 10.0));
//Script that was called. Parameters are available as individual variables in the
//global variable $_IPS. The variable name corresponds to the array index
//given name.
$Headline = $_IPS['Title']. "progress"; //Results: Temp.progress
$MaxTemp = $Tmin + 30.0;