« Back to Product

Documentation

IPS_SetEventConditionDayOfTheWeekRule

Require: IP-Symcon >= 5.2

 boolean IPS_SetEventConditionDayOfTheWeekRule (int $EventID, int $ConditionID, int $RuleID, int $Comparison, int $Weekday) 

Parameters

EventID

ID of the event to be changed

ConditionID

ID of the condition that contains the rule

RuleID

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

Comparison
Value Description
0 ==
1 !=
2 >
3 >=
4 <
5 <=
Weekday
Value Description
0 Delete
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday
7 Sunday

Returns

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

Description

This function modifies the rule with the ID RuleID of the condition with the ID ConditionID of the event with the ID EventID. The rule compares the current day of the week with the day of the week, according to the comparison operation Comparison. If there is no rule with the ID RuleID, one will be created.

If the value Weekday is 0, the rule with the ID RuleID will be deleted.

Warning

Which rule ID contains which rule can be looked up via IPS_GetEvent.

Example

//Add an AND condition
IPS_SetEventCondition(12345, 0, 0, 0)

// Adds / modifies the rule with the ID 2 for the event with the object ID 12345
// It is greater than or equal to Thursday i.e.: Thursday to Sunday included
IPS_SetEventConditionDayOfTheWeekRule(12345, 0, 2, 3, 4);

// Adds / modifies the rule with the ID 3 for the event with the object ID 12345
// It is unequal to Sunday
IPS_SetEventConditionDayOfTheWeekRule(12345, 0, 3, 1, 7);

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