« Back to Product

Documentation

IPS_SetEventConditionVariableRule

Require: IP-Symcon >= 4.4

 boolean IPS_SetEventConditionVariableRule (int $EventID, int $ConditionID, int $RuleID, int $VariableID, int $Comparison, variant $Value) 

Parameters

EventID

ID of the event to be changed

ConditionID

ID of the condition that contains the rule

RuleID

Unique ID for this rule. IDs only need to be unique for this group.

VariableID

ID of the checked variable

Comparison
Value Description
0 ==
1 !=
2 >
3 >=
4 <
5 <=
Value

Value the checked variable is compared to

Returns

If the command succeeds, it returns TRUE, otherwise FALSE.

Description

Warning

This function is deprecated. Please use the newer IPS_SetEventConditionVariableStaticRule function, which has the same parameters and a better naming

This function modifies the rule with the ID RuleID for the condition with the ID ConditionID of the event with the ID EventID. The rule compares the variable with the ID VariableID to the value Value according to the comparison operation Comparison. If no rule with the ID RuleID exists yet, it is created.

If VariableID is 0, the rule with the ID RuleID is deleted.

Warning

The variable types Boolean and String only support the first two comparison operations.

Warning

The value in Value must match the type of the variable with the ID VariableID.

Example

// Create root condition for event with ID 12345
IPS_SetEventCondition(12345, 0, 0, 0);

// Add a rule with ID 2: Variable 23456 < 75
IPS_SetEventConditionVariableRule(12345, 0, 2, 23456, 4, 75);

// Delete rule with ID 2
IPS_SetEventConditionVariableRule(12345, 0, 2, 0, 0, 0);
Any questions?