yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Quintiq file version 2.0
#parent: #root
Method SetRecurrencePatternWeekly (
  Number weekday_i
) as LibCal_Event
{
  Description: 'Set a recurrence pattern for a specific day of the week.'
  TextBody:
  [*
    // Use a FeedbackObject the collect the validation feedback.
    feedback := LibCal_Validate::FeedbackObject(); 
    
    moreInfo := this.GetEventInfo();
    LibCal_Validate::RegisterError( LibCal_Validate::Event_Pattern_Weekday( weekday_i ), moreInfo );
    
    // Process the feedback that has been registered by the validation (if any).
    LibCal_Util::ProcessFeedbackObject( feedback );
    
    // The below is only executed when no validation errors were encountered.
    onMonday    := weekday_i = monday;
    onTuesday   := weekday_i = tuesday;
    onWednesday := weekday_i = wednesday;
    onThursday  := weekday_i = thursday;
    onFriday    := weekday_i = friday;
    onSaturday  := weekday_i = saturday;
    onSunday    := weekday_i = sunday;
    
    // Make the API fluent.
    return this.SetRecurrencePatternWeekly( onMonday, onTuesday, onWednesday, onThursday, onFriday, onSaturday, onSunday );
  *]
}