Documentation
IPS_RunScript
bool IPS_RunScript (int $ScriptID)
Parameters
| ScriptID | Unique ID of the script |
Returns
If the function succeeds, it returns TRUE, otherwise FALSE.
Description
The function starts the script with the ID ScriptID. The called script runs in parallel (simultaneously) to the calling script.
Scripts that are executed via IPS_RunScript use the following System Variables.
Comparison between IPS_RunScript and the PHP statement include:
include is a PHP statement, not an IPS function. The script included by include is executed as if it were placed instead of the include statement. It behaves as if it were part of the calling script. This means that all variables known to the calling script are also available to the included script. The runtime of the script is extended by the runtime of the included script.
When using IPS_RunScript the called script is launched in a separate context. It therefore knows nothing of the variables of the calling script. Data can only be exchanged via external variables. The function is suitable for situations where a script must be executed in a timely manner, but no direct connection to the calling script is required. The runtime of the script does not change, since both scripts are running (almost) simultaneously.
Example
IPS_RunScript(12345 /*[Garden lighting On]*/);