Documentation
IPS_RunScriptWaitEx
string IPS_RunScriptWaitEx (int $ScriptID, array $Parameter)
Parameters
| ScriptID | Unique ID of the script |
| Parameter | Key (string) => Value (variant) pairs that can be accessed in the newly executed script. |
Returns
Result of the executed script
Description
The function starts the script with the ID ScriptID, passes the array Parameter as argument and waits for the end of the script execution to return its result. The notes described for IPS_RunScript apply here as well.
The array Parameter can contain any number of "Key => Value" pairs (see PHP arrays). Each pair is available in the called script in the global variable __$_IPS at the index Key with its content Value__.
Example
//Script, that will launch another script with parameter passing.
echo IPS_RunScriptWaitEx(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
echo $_IPS['Tmin'] + 30.0;