Documentation
IPS_SetVariableCustomAction
bool IPS_SetVariableCustomAction (int $VariableID, int $ScriptID)
Parameters
| VariableID | ID of the variable |
| ScriptID | ID of the script that should be used as variable action. The nonexistent ScriptID 1 ( |
Returns
If the function succeeds, it returns TRUE, otherwise FALSE.
Description
This function assigns a custom action to the variable with the ID VariableID. The custom action is used in the visualization to forward a change in the variable to the proper function of the module. Examples of action scripts can be found here: Action Scripts
Besides a ScriptID, the following values can be specified:
| Value | Constant | Description |
|---|---|---|
| 0 | VARIABLE_ |
No custom action. The default action is used, if available. |
| 1 | VARIABLE_ |
The default action is disabled. |
Example
// Set script 44431 as action of variable 12345
IPS_SetVariableCustomAction(12345, 44431);
// Disable the default action of variable 12345
IPS_SetVariableCustomAction(12345, VARIABLE_ACTION_DISABLED);
// Enable the default action of variable 12345 again
IPS_SetVariableCustomAction(12345, VARIABLE_ACTION_NONE);