home *** CD-ROM | disk | FTP | other *** search
/ PDA Software Library / pdasoftwarelib.iso / PSION / 1997 / 969 / HOL / EXAMPLE.HOL < prev    next >
Encoding:
Text File  |  1997-02-02  |  4.7 KB  |  121 lines

  1. ! This is an example holiday file for HOL. 
  2. ! All text between an exclamation mark and the end of line is a comment.
  3. REM "REM" can be used instead of "!"
  4.  
  5. ! Put an entry called "Christmas Day" on December 25th
  6. "Christmas Day" = fix(12, 25);       ! fix(month, day-in-month)
  7.  
  8. ! Set the default style to italic. 
  9. style = italic; ! Other styles are "bold", "underline", "normal"
  10.  
  11. ! Set a default year symbol for the year view
  12. year_symbol = "H";                   ! One character within quotes
  13. "New Year's Day" = fix(1, 1);        ! January 1st 
  14.  
  15.  
  16. ! You can use different values for style and/or year_symbol for one holiday.
  17. ! Put the directives within curly brackets:
  18. {
  19.    YEAR_SYMBOL = "A";               ! Only for this holiday
  20.    "St. Valentines Day" = FIX(2,2); ! Only one holiday within brackets
  21.    STYLE = ITALIC,BOLD,UNDERLINE;   ! Only for this holiday
  22. }
  23. ! The following will be bold with year_symbol "H" as before.
  24.  
  25. ! EASTER is a special keyword for Easter Sunday
  26. ! Save the date as alias E for convenience (and speed).
  27. {alias = E;                         ! Always within brackets
  28. "Easter" = easter;}
  29. "Good Friday" = e - 2 ;             ! Two days before easter Sunday
  30. "Easter Monday"=e+1;                ! One day after easter Sunday
  31.  
  32. ! Hebrew fixed date. '%HY' will be replaced by the Hebrew year
  33. "Rosh HaShanah %hy" = hfix(7,1);    ! hfix(hebrew-month, day-in-month)
  34.  
  35. ! Islamic fixed date. '%IY' will be replaced by the Islamic year.
  36. "Islamic New Year %iy" = ifix(1, 1);
  37.  
  38.  
  39. ! The defaults can be changed
  40. year_symbol = "a";
  41. style = normal;
  42.  
  43. ! Midsummer day is on the 1st Saturday in June after the 20th
  44. "Midsommardagen" = float(6,         ! June
  45.                          6,         ! Saturday (Sunday = 0)
  46.                          1,         ! 1st (negative would be last in month)
  47.                          20);       ! after the 20th (optional)
  48.  
  49. "Mother's Day" = float(5, 0 , 2);   ! Second Sunday in May
  50.  
  51. year_symbol = "";                   ! No year symbol
  52.  
  53. ! We can use if/elseif/else to do different calculations 
  54. ! depending on whether the calculated date is on a certain
  55. ! weekday
  56.  
  57. ! The time report is due on the last working day of February
  58. "Tidrapporten!" = last(2)           ! Last day of February
  59.                   if (weekday(6) or ! Is that a Saturday or 
  60.                       weekday(0))   ! Sunday?
  61.                   {
  62.                     float(2, 5, -1) ! Yes, get the last Friday instead
  63.                   };
  64.  
  65. ! We can add several 'elseif' and at most one 'else' after the 'if'
  66. "Yom HaAtzma'ut" = hfix(1,15)
  67.                    if (weekday(0)) {! Is 1/15 a Sunday?
  68.                       +18           ! Yes, add 18 days to 1/15
  69.                    } elseif (weekday(6)) { ! Is 1/15 a Saturday?
  70.                       + 19          ! Yes, add 19 days to 1/15
  71.                    } else {         ! For all other weekdays
  72.                       +20           ! Add 20 days to 1/15
  73.                    };
  74.  
  75. ! Some holidays don't occur at all some years
  76. ! There's always a bank holiday for New Years Day, so if
  77. ! Jan 1st is in the weekend they add a holiday on Monday
  78. ! (excellent rule :-))
  79. "New Year's Day Holiday" = 
  80.     fix(1,1)                        ! January 1
  81.     if (weekday(0) or weekday(6)) { ! Sunday or Saturday
  82.       float(1, 1, 1)                ! First Monday in January
  83.     } else {
  84.       ignore        ! Same as New Year's Day - don't write it
  85.     };
  86.  
  87. ! 'doneif' was my first attempt to include a condition check.
  88. ! It's easier to use the newer if/elseif/else constructs, 
  89. ! but I'll include an example here anyway.
  90. "Aniversario San Martín" = 
  91.                  fix(8, 17)         ! Usually on August 17
  92.                  doneif(weekday(6)  ! Check that it's a Saturday
  93.                      or weekday(0)  ! or Sunday
  94.                      or weekday(1)) ! or Monday and skip the rest if
  95.                                     ! that is true
  96.                  float(8, 1, 1, 15);! Otherwise get the Monday closest
  97.                                     ! to Aug 17 (first after the 15th)
  98.  
  99. ! Holidays are written as untimed entries by default, but that can be
  100. ! controlled with the entry_type directive.
  101.  
  102. ! Some people prefer to have holidays marked with the anniversary symbol
  103. ENTRY_TYPE = ANNIVERSARY;
  104. "An anniversary" = fix(9, 7);
  105.  
  106. ! Entry types can be changed for one holiday if put within brackets.
  107. {
  108.    ENTRY_TYPE = UNTIMED;
  109.    "An untimed entry" = fix(6, 1);
  110. }
  111.  
  112. ! This date will not be written to the agenda. It is used as the base
  113. ! for calculating several holidays, and we save time by calculating it
  114. ! only once.
  115.   alias = t; 
  116.   entry_type = ignore;  ! Don't write to agenda - only a help variable
  117.   "[Tish'a B'Av help date]" = hfix(5,9);
  118. }
  119.  
  120.