home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / remin310.zip / defs.rem next >
Text File  |  1993-10-13  |  22KB  |  609 lines

  1. #############################################################################
  2. #                                         #
  3. # DEFS.REM                                    #
  4. #                                         #
  5. # This file is a reminder script, which contains a few handy definitions.   #
  6. # Cut and paste as desired!  Also, near the end, there are a bunch of        #
  7. # holiday definitions for the U.S.                        #
  8. #                                         #
  9. # Some examples provided by George M. Sipe <gsipe@pyratl.ga.pyramid.com>    #
  10. #                                         #
  11. # U.S. holidays provided by Dave Rickel <drickel@sjc.mentorg.com>        #
  12. #                                         #
  13. # Use your text editor to search for:                        #
  14. #  "#USHOLS" for U.S. holidays                            #
  15. #  "#JHOLS"  for Jewish holidays                        #
  16. #  "#PSSTUFF" for nifty PostScript examples                    #
  17. #  "#COLORS" for examples of ANSI color escape sequences.                   #
  18. #                                         #
  19. # This file is part of REMIND.                            #
  20. # Copyright (C) 1992, 1993 by David F. Skoll                    #
  21. #                                         #
  22. #############################################################################
  23.  
  24. RUN OFF
  25.  
  26. ################################################
  27. # Ensure required version of remind is used... #
  28. ################################################
  29. IF version() < "03.00.10"
  30.    ERRMSG This file requires at least version 03.00.10 of Remind.%
  31.    ERRMSG This version is version [version()].
  32.    EXIT
  33. ENDIF
  34.  
  35. ######################################
  36. # Symbolic constants for weekdays... #
  37. ######################################
  38. SET Sunday    0
  39. SET Monday    1
  40. SET Tuesday   2
  41. SET Wednesday 3
  42. SET Thursday  4
  43. SET Friday    5
  44. SET Saturday  6
  45.  
  46. SET Sun 0
  47. SET Mon 1
  48. SET Tue 2
  49. SET Wed 3
  50. SET Thu 4
  51. SET Fri 5
  52. SET Sat 6
  53.  
  54. #########################################
  55. # Symbolic constants for month names... #
  56. #########################################
  57.  
  58. SET Jan 1
  59. SET Feb 2
  60. SET Mar 3
  61. SET Apr 4
  62. SET May 5
  63. SET Jun 6
  64. SET Jul 7
  65. SET Aug 8
  66. SET Sep 9
  67. SET Oct 10
  68. SET Nov 11
  69. SET Dec 12
  70.  
  71. SET January   1
  72. SET February  2
  73. SET March     3
  74. SET April     4
  75. SET May       5
  76. SET June      6
  77. SET July      7
  78. SET August    8
  79. SET September 9
  80. SET October   10
  81. SET November  11
  82. SET December  12
  83.  
  84. ###########################################################
  85. # Other symbolic constants and functions for "pasting"... #
  86. ###########################################################
  87.  
  88. SET Quote CHAR(34)
  89.  
  90. # Handy constants/function for specifing week of month...
  91. SET  Week_1         1
  92. SET  Week_2         8
  93. SET  Week_3        15
  94. SET  Week_4        22
  95. FSET _last(mo)        "1 " + MON((mo%12)+1)+" --7"
  96.  
  97. # Shorthand for commonly used expression...
  98. FSET _trig()        TRIGGER(TRIGDATE())
  99.  
  100. # Handy function to provide SCANFROM dates...
  101. FSET _back(days)    TRIGGER(TODAY()-days)
  102.  
  103. ###########################################################
  104. # On MS-DOS systems, the standard C library functions are #
  105. # not reliable for computing offsets from local time to   #
  106. # UTC.  The following provides a work-around for the      #
  107. # sunrise() and sunset() functions.  Note, however, that  #
  108. # if Daylight Savings Time is in effect for today(), the  #
  109. # sun functions return times in DST even for dates on     #
  110. # which DST is not in effect; the converse can also occur.#
  111. #                                                         #
  112. # Change the timezone to your timezone - the default is   #
  113. # for EST which is 5 hours (300 minutes) behind UTC.      #
  114. # The code is correct for places in which Daylight Savings#
  115. # Time begins on the last Sunday in April and ends on the #
  116. # last Sunday in October.                                 #
  117. ###########################################################
  118.  
  119. IF OSTYPE() == "MSDOS"
  120.     # Eastern Standard Time
  121.     SET TimeZone -300
  122.  
  123.     # Use --8 rather than --7 because we want the last day BEFORE
  124.     # the time switch occurs.
  125.     REM Sun 1 May --8 SATISFY 1
  126.     SET BegDst TRIGDATE()
  127.  
  128.     REM Sun 1 Nov --8 SATISFY 1
  129.     SET EndDst TRIGDATE()
  130.  
  131.     SET $CalcUTC 0
  132.  
  133.     # Check out the following IF statement and figure out why it works!
  134.     IF EndDst < BegDst
  135.         # Daylight Savings Time
  136.         SET $MinsFromUTC TimeZone+60
  137.     ELSE
  138.         # Standard Time
  139.         SET $MinsFromUTC TimeZone
  140.     ENDIF
  141. ENDIF
  142.  
  143. ###########################################################
  144. # Function which returns a string in "am/pm" format based #
  145. # on the time.  For example, set a am_pm(NOW())...        #
  146. ###########################################################
  147.  
  148. FSET _am_pm(tm)    IIF(tm<01:00, tm+12*60+"am", \
  149.                     tm<12:00, tm+"am", \
  150.                     tm<13:00, tm+"pm", \
  151.                               tm-12*60+"pm")
  152.  
  153. #################################################################
  154. # Function which removes a single leading zero from a string... #
  155. #################################################################
  156.  
  157. FSET _no_lz(s) IIF(SUBSTR(s, 1, 1)=="0", SUBSTR(s, 2), s)
  158.  
  159. ############################################################
  160. # Function to calculate number of years since a given year #
  161. # or number of months since a given month and year...      #
  162. ############################################################
  163.  
  164. FSET _yr_num(yr)        ORD(YEAR(TRIGDATE()) - yr)
  165. FSET _mo_num(mo, yr)        ORD(12 * (YEAR(TRIGDATE()) - yr) + \
  166.                     MONNUM(TRIGDATE()) - mo)
  167.  
  168. # Here's an example of how to use them:
  169. REM 1 Nov ++12 MSG %"Dean's [_yr_num(1984)] birthday%" is %b.
  170. REM 1 MSG Dean's [_mo_num(11, 1984)] 'monthly' anniversary
  171.  
  172. ###########################################################
  173. # Function to send mail via elm's "fastmail" (by GMS!)... #
  174. ###########################################################
  175.  
  176. #FSET _mail(from, subj)    "mailx -s " + \
  177. #                Quote + from + " : " + subj + Quote \
  178. #                GETENV("LOGNAME") + " < /dev/null 1>&0"
  179. FSET _mail(from, subj)    "fastmail -f " + \
  180.                 Quote + from + Quote + \
  181.                 " -s " + Quote + subj + Quote + \
  182.                 " /dev/null " + GETENV("LOGNAME")
  183.  
  184. #############################################################################
  185. # Here's a tricky problem:  The 4th of July is a holiday in the U.S.
  186. # However, if it falls on a Saturday, the previous Friday is a holiday.
  187. # If it falls on a Sunday, the next Monday is a holiday.  Here's how
  188. # to do it.  NOTE that the following procedure makes the OMIT context
  189. # dependent upon the current date.  SInce it only depends on the current
  190. # year, which is not likely to change while producing a calendar, we
  191. # are fairly safe.  However, reminders with huge DELTA or BACK components
  192. # may not operate as expected.  In general, any time you make OMIT
  193. # dependent upon the current date, it's tricky and results may not be
  194. # what you expect.  You should try to make sure that the OMIT context
  195. # "near" any current reminders will not change during a calendar run.
  196. # The SCANFROM clause should help make these OMITs very safe.
  197. ############################################################################
  198.  
  199. # Calculate the weekday of the holiday.
  200. REM 4 July SCANFROM [_back(7)] SATISFY 1
  201.  
  202. IF WKDAYNUM(TRIGDATE()) == Sat
  203.     REM [TRIGGER(TRIGDATE())] MSG Independence day (actual)
  204.     OMIT [TRIGGER(TRIGDATE()-1)] MSG Independence day (observed)
  205. ELSE
  206.     IF WKDAYNUM(TRIGDATE()) == Sun
  207.         REM [TRIGGER(TRIGDATE())] MSG Independence day (actual)
  208.         OMIT [TRIGGER(TRIGDATE()+1)] MSG Independence day (observed)
  209.     ELSE
  210.         OMIT [TRIGGER(TRIGDATE())] MSG Independence day
  211.     ENDIF
  212. ENDIF
  213.  
  214. ############################################################################
  215. #                                       #
  216. # A meeting on the first Monday of every month which is moved to the       #
  217. # second Monday in the event of a holiday.                                 #
  218. #                                       #
  219. ############################################################################
  220.  
  221. # First, the normal meeting.  However, the SKIP keyword means this
  222. # one won't be triggered if the first Monday is a holiday
  223. REM Mon 1 SKIP MSG Meeting
  224.  
  225. # Now, calculate the "potential" delayed meeting
  226. REM Mon 8 SATISFY 1
  227.  
  228. # But only actually trigger the delayed meeting if the previous
  229. # Monday was a holiday
  230. IF ISOMITTED(TRIGDATE()-7)
  231.    REM [TRIGGER(TRIGDATE())] MSG Delayed meeting
  232. ENDIF
  233.  
  234. ############################################################################
  235. #                                       #
  236. # A very complicated reminder sent in by a Remind user.               #
  237. # This person gets paid every two weeks, starting from 8 January 1993.       #
  238. # If a pay date occurs before the twelfth of a month, then that           #
  239. # he pays his mortgage on that pay date.  Otherwise, he pays the mortgage  #
  240. # on the previous pay date.  Furthermore, he has to schedule his       #
  241. # mortgage payment six days before it is due.  He wants to be reminded       #
  242. # a further four days before the scheduling deadline.  He also           #
  243. # wants to be mailed a notice two weeks before the scheduling deadline.       #
  244. #                                       #
  245. # Here's the solution - if you can follow this, consider yourself a       #
  246. # Remind programmer extraordinaire!                       #
  247. #                                       #
  248. ############################################################################
  249.  
  250. # A function to determine whether or not a pay-date is a mortgage-date.
  251.  
  252. FSET _IsMortDate(x) DAY(x) < 12 || (DAY(x+14) >= 12 && DAY(x+14) <= 14)
  253.  
  254. # Paydays - for reference
  255.  
  256. REM 8 Jan 1993 *14 MSG Payday
  257.  
  258. # Calculate the mortgage payment six days ahead of time.  Note that this
  259. # is done "implicitly" by subtracting 6 from the starting date - we start
  260. # on 2 Jan rather than 8 Jan.  We add 6 to TRIGDATE() in _IsMortDate to
  261. # compensate.
  262.  
  263. REM 2 Jan 1993 *14 ++4 SATISFY [_IsMortDate(TRIGDATE()+6)] \
  264.     MSG %"Schedule mortgage payment%" for %a.
  265.  
  266. # Now the mail reminder two weeks before the payment date - because two
  267. # weeks before a payment date is also a payment date, no pre-compensation
  268. # in the starting date of 8 Jan is necessary - convince yourself of this!
  269. # This uses the _mail() function defined earlier.
  270.  
  271. REM ONCE 8 Jan 1993 *14 SATISFY [_IsMortDate(TRIGDATE()+14)] \
  272.     RUN [_mail("Decatur Federal", \
  273.         "Pay mortgage by the " + ORD(DAY(TRIGDATE()+14)))]
  274.  
  275. # Make an entry on the calendar when the mortgage should be paid
  276.  
  277. REM 8 Jan 1993 *14 SATISFY [_IsMortDate(TRIGDATE())] \
  278.     CAL Mortgage payment
  279.  
  280. ##########################################################################
  281. #                                         #
  282. # On our UNIX system, I run a program which queries the university       #
  283. # library and creates a file called ".booksdue".  This file is           #
  284. # a REMIND script to tell me when my library books are due.  Here's      #
  285. # an example from my reminder file - it shows the use of filedate().     #
  286. # When the .booksdue file is at least 7 days old, I create a new version #
  287. # by querying the library computer.  Note the use of realtoday() rather  #
  288. # than today.                                    #
  289. #                                         #
  290. ##########################################################################
  291.  
  292. IF !$RunOff && !$CalMode && !$SimpleCal
  293.    IF REALTODAY()-FILEDATE("/home/dfs/.booksdue") >= 7
  294.       REM RUN /home/dfs/bilge/library/getbooks
  295.    ENDIF
  296. ENDIF
  297.  
  298. #PSSTUFF
  299. ##########################################################################
  300. #                                         #
  301. # This portion of the file contains some cute examples of the new        #
  302. # PS-type reminders.  You need a PostScript printer or viewer to         #
  303. # appreciate these.  To use them, pipe the output of remind -p into the  #
  304. # rem2ps program.                                                        #
  305. #                                         #
  306. ##########################################################################
  307.  
  308. # Convenient to stick all the PostScript code in a string var - makes
  309. # reminders easier to understand and faster.  The variable "shade" will
  310. # contain PostScript code to shade in a particular box on the calendar.
  311. SET shade psshade(95)
  312.  
  313. # The following reminder will shade the Saturday and Sunday calendar
  314. # entries.
  315. REM Sat Sun PS [shade]
  316.  
  317. # The following will fill in the Hebrew dates on the calendar.  For this
  318. # example, I recommend that you use the -sd 10 option for Rem2PS.
  319. REM PS Border Border moveto \
  320.    /DayFont findfont DaySize scalefont setfont \
  321.    ([hebday(today())] [hebmon(today())]) show
  322.  
  323. # Fill in the phases of the moon on the PostScript calendar
  324. [trigger(moondate(0))] PS [psmoon(0)]
  325. [trigger(moondate(1))] PS [psmoon(1)]
  326. [trigger(moondate(2))] PS [psmoon(2)]
  327. [trigger(moondate(3))] PS [psmoon(3)]
  328.  
  329. #USHOLS
  330. #############################################################################
  331. #                                           #
  332. # The following holidays were provided by Dave Rickel                #
  333. # Modified by D. Skoll to give safe OMITs for moveable holidays            #
  334. #                                        #
  335. #############################################################################
  336.  
  337. SET SaveTrig $NumTrig
  338. SET easter EASTERDATE(YEAR(TODAY()))
  339. REM  [TRIGGER(easter-46)] MSG %"Ash Wednesday%"
  340. REM  [TRIGGER(easter-7)]  MSG %"Palm Sunday%"
  341. OMIT [TRIGGER(easter-2)]  MSG %"Good Friday%"
  342. OMIT [TRIGGER(easter)]    MSG %"Easter%" Sunday
  343. REM  [TRIGGER(easter+39)] MSG %"Ascension Day%"
  344. REM  [TRIGGER(easter+49)] MSG %"Pentecost%"
  345.  
  346. # Some holidays are omitted, some are not.  You may want to change
  347. # which ones are omitted - use the general forms shown below.
  348. # You'll need the _back() function and the Week_n variables defined
  349. # way up in the file.
  350.  
  351. OMIT     Jan  1        MSG %"New Year's%" Day
  352. REM  Mon Jan [Week_3]    MSG Martin Luther King - %"MLK Day%"
  353. REM      Feb  2        MSG %"Ground Hog Day%"
  354. REM      Feb 14        MSG %"Valentine's%" Day
  355. REM  Mon Feb [Week_3]    SCANFROM [_back(7)] SATISFY 1
  356.             OMIT [_trig()] MSG %"President's Day%"
  357. REM      Mar 17        MSG %"St. Patrick's%" Day
  358. REM  Sun Apr  1 ++2    MSG Daylight Savings Time - %"DST starts%" %b
  359. REM      Apr  1        MSG %"April Fool's%" Day
  360. REM  Mon Tue Wed Thu Fri Sat 15 Apr MSG %"Income tax%" due
  361. REM      May  5        MSG %"Cinco de Mayo%"
  362. REM  Sat May [Week_1]    MSG %"Kentucky Derby%"
  363. REM  Sun May [Week_2]    MSG %"Mother's Day%"
  364. REM  Sat May [Week_3]    MSG %"Armed Forces Day%"
  365. REM  Mon [_last(May)]    SCANFROM [_back(7)] SATISFY 1
  366.             OMIT [_trig()] MSG %"Memorial Day%"
  367. REM      Jun 14        MSG %"Flag Day%"
  368. REM  Sun Jun [Week_3]    MSG %"Father's Day%"
  369. REM  Mon Sep [Week_1]    SCANFROM [_back(7)] SATISFY 1
  370.             OMIT [_trig()] MSG %"Labor Day%"
  371. REM  Mon Oct [Week_2]    MSG %"Columbus Day%"
  372. REM      Nov 11        MSG %"Veterans Day%"
  373. REM  Sun [_last(Oct)]    MSG Daylight Savings Time - %"DST over%"
  374. REM      Oct 30        MSG %"Mischief Night%"
  375. REM      Oct 31        MSG %"Halloween%"
  376. REM  Tue Nov  2        SCANFROM [_back(7)] \
  377.     SATISFY [(YEAR(TRIGDATE()) % 4) == 0] \
  378.     MSG %"Election%" Day
  379. REM  Thu Nov [Week_4]    SCANFROM [_back(7)] SATISFY 1
  380.             OMIT [_trig()] MSG %"Thanksgiving%" Day
  381. REM  Fri Nov [Week_4+1]    SCANFROM [_back(7)] SATISFY 1
  382.             OMIT [_trig()] MSG %"Thanksgiving%" (cont.)
  383. OMIT     Dec 24        MSG %"Christmas Eve%"
  384. OMIT     Dec 25        MSG %"Christmas%" Day
  385.  
  386. ##########################################################################
  387. #                                         #
  388. # The next block uses the shade variable defined in PSSTUFF above.       #
  389. # If any US holidays were triggered above, shade in the calendar         #
  390. # entry in PostScript.  This is not quite correct, as it blots out the   #
  391. # other PostScript stuff above.  I was too lazy to do it properly :-)    #
  392. #                                         #
  393. ##########################################################################
  394. if $NumTrig > SaveTrig
  395.     REM PS [shade]
  396. endif
  397.  
  398. # Seasons (valid from 1992 to 2000)...
  399. REM Mar 20 MSG %"Spring%" begins
  400. REM Jun [IIF(YEAR(TODAY())%4, 21, 20)] MSG %"Summer%" begins
  401. REM Sep [CHOOSE(YEAR(TODAY())-1991, 22,22,23,23,22,22,22,23,22)] \
  402.     MSG %"Fall%" begins
  403. REM Dec [IIF((YEAR(TODAY())+1)%4, 21, 22)] MSG %"Winter%" begins
  404.  
  405. #JHOLS
  406. ##########################################################################
  407. #                                         #
  408. # This portion of the file contains reminders for Jewish holidays.  The     #
  409. # dates were obtained from "The First Jewish Catalog" by Richard Siegel     #
  410. # and Michael and Sharon Strassfeld, published by the Jewish Publication #
  411. # Society of America.  The Reform version of the calendar was guessed     #
  412. # at by David Skoll based on experience.  Additional corrections were    #
  413. # made from the paper "Calendrical Calculations" by Nachum Dershowitz    #
  414. # and Edward M. Reingold.  Any further corrections are welcome.          #
  415. #                                     #
  416. ##########################################################################
  417.  
  418. # Here are some general functions that you might find nice to use
  419.  
  420. # _hstr:  Returns a string which is the full Hebrew date of its argument.
  421. #         Example: hstr('1994/02/02') returns "21 Shvat 5754"
  422. FSET _hstr(x) HEBDAY(x) + " " + HEBMON(x) + " " + HEBYEAR(x)
  423.  
  424. # _hyrlen:  Return the length of the specified Hebrew year
  425. #           Example: _hyrlen(5754) returns 355
  426. FSET _hyrlen(x) HEBDATE(1, "Tishrey", x+1) - HEBDATE(1, "Tishrey", x)
  427.  
  428. # --- HERE ARE THE JEWISH HOLIDAYS ---
  429. # Set the variable InIsrael to 1 if you live in Israel.  Otherwise,
  430. # you get the Diaspora versions of Jewish holidays
  431. SET InIsrael 0
  432.  
  433. # Set the variable Reform to 1 if you want the Reform version of the
  434. # Jewish calendar.  Otherwise, you get the traditional version
  435. SET Reform 0
  436.  
  437. # Convenient function definition to save typing
  438. FSET _h(x, y) TRIGGER(HEBDATE(x,y))
  439. FSET _h2(x, y) HEBDATE(x, y, TODAY()-7)
  440. FSET _PastSat(x, y) IIF(WKDAYNUM(_h2(x,y))!=6, \
  441.             TRIGGER(_h2(x,y)), \
  442.             TRIGGER(_h2(x,y)+1))
  443.  
  444. # Default values in case InIsrael and Reform are not set
  445. SET InIsrael VALUE("InIsrael", 0)
  446. SET Reform   VALUE("Reform", 0)
  447.  
  448. [_h(1,  "Tishrey")] ++4 MSG %"Rosh Hashana 1%" is %b.
  449.  
  450. # No RH-2 or Tzom Gedalia in Reform
  451. IF !Reform
  452.    [_h(2,  "Tishrey")] ++4 MSG %"Rosh Hashana 2%" is %b.
  453.    [_PastSat(3,  "Tishrey")] ++4 MSG %"Tzom Gedalia%" is %b.
  454. ENDIF
  455.  
  456. [_h(10, "Tishrey")] ++4 MSG %"Yom Kippur%" is %b.
  457. [_h(15, "Tishrey")] ++4 MSG %"Sukkot 1%" is %b.
  458.  
  459. IF !InIsrael
  460.    [_h(16, "Tishrey")] MSG %"Sukkot 2%"
  461. ENDIF
  462.  
  463. [_h(21, "Tishrey")] ++4 MSG %"Hashana Rabba%" is %b.
  464. [_h(22, "Tishrey")] ++4 MSG %"Shemini Atzeret%" is %b.
  465.  
  466. IF InIsrael
  467.    [_h(22, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b.
  468. ELSE
  469.    [_h(23, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b.
  470. ENDIF
  471.  
  472. # Because Kislev can change length, we must be more careful about Chanukah
  473. FSET _chan(x) TRIGGER(HEBDATE(24, "Kislev", today()-9)+x)
  474. [_chan(1)] ++4 MSG %"Chanukah 1%" is %b.
  475. [_chan(2)] MSG %"Chanukah 2%"
  476. [_chan(3)] MSG %"Chanukah 3%"
  477. [_chan(4)] MSG %"Chanukah 4%"
  478. [_chan(5)] MSG %"Chanukah 5%"
  479. [_chan(6)] MSG %"Chanukah 6%"
  480. [_chan(7)] MSG %"Chanukah 7%"
  481. [_chan(8)] MSG %"Chanukah 8%"
  482.  
  483. # Not sure about Reform's position on the next one.
  484. IF !Reform
  485. # The fast is moved to the 11th if the 10th is a Saturday
  486.    REM [_PastSat(10, "Tevet")] MSG %"Tzom Tevet%" is %b.
  487. ENDIF
  488.  
  489. [_h(15, "Shvat")] ++4 MSG %"Tu B'Shvat%" is %b.
  490. [_h(15, "Adar A")] ++4 MSG %"Purim Katan%" is %b.
  491.  
  492. # If Purim is on Sunday, then Fast of Esther is 11 Adar.
  493. IF WKDAYNUM(_h2(13, "Adar")) != 6
  494.    REM [TRIGGER(_h2(13, "Adar"))] ++4 MSG %"Fast of Esther%" is %b.
  495. ELSE
  496.    REM [TRIGGER(_h2(11, "Adar"))] ++4 MSG %"Fast of Esther%" is %b.
  497. ENDIF
  498. [_h(14, "Adar")] ++4 MSG %"Purim%" is %b.
  499. [_h(15, "Nisan")] ++4 MSG %"Pesach%" is %b.
  500.  
  501. IF !InIsrael
  502.    [_h(16, "Nisan")] MSG %"Pesach 2%"
  503. ENDIF
  504.  
  505. [_h(21, "Nisan")] MSG %"Pesach 7%"
  506.  
  507. IF !InIsrael && !Reform
  508.    [_h(22, "Nisan")] MSG %"Pesach 8%"
  509. ENDIF
  510.  
  511. [_h(27, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b.
  512. [_h(4,  "Iyar")] ++4 MSG %"Yom HaZikaron%" is %b.
  513. [_h(5,  "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
  514.  
  515. # Not sure about Reform's position on Lag B'Omer
  516. IF !Reform
  517.    [_h(18, "Iyar")] ++4 MSG %"Lag B'Omer%" is %b.
  518. ENDIF
  519.  
  520. [_h(28, "Iyar")] ++4 MSG %"Yom Yerushalayim%" is %b.
  521. [_h(6,  "Sivan")] ++4 MSG %"Shavuot%" is %b.
  522.  
  523. IF !InIsrael && !Reform
  524.    [_h(7, "Sivan")] MSG %"Shavuot 2%"
  525. ENDIF
  526.  
  527. # Fairly sure Reform Jews don't observe the next two
  528. IF !Reform
  529. # Tzom Tamuz and Tish'a B'Av are moved to Sunday if they normally
  530. # fall on a Saturday
  531.    [_PastSat(17, "Tamuz")] ++4 MSG %"Tzom Tammuz%" is %b.
  532.    [_PastSat(9,  "Av")] ++4 MSG %"Tish'a B'Av%" is %b.
  533. ENDIF
  534.  
  535. # Counting the omer - do the whole spiel, i.e:
  536. # "This is the xth day of the omer, being y weeks and z days of the omer."
  537. # Nice Remind programming example here!
  538. SET ostart HEBDATE(16, "Nisan", TODAY()-50)
  539. IF ostart <= TODAY() && (TODAY() - ostart < 49)
  540.    SET odays TODAY()-ostart+1
  541.    IF odays < 7
  542.       MSG %"%"Today is the [ORD(odays)] day of the Omer.
  543.    ELSE
  544.       IF !(odays % 7)
  545.          MSG %"%"Today is the [ORD(odays)] day of the Omer, being [odays / 7] [PLURAL(odays/7, "week")] of the Omer.
  546.       ELSE
  547.      MSG %"%"Today is the [ORD(odays)] day of the Omer, being [odays/7] [PLURAL(odays/7, "week")] and [odays%7] [PLURAL(odays%7, "day")] of the Omer.
  548.       ENDIF
  549.    ENDIF
  550.    CAL [ORD(odays)] of Omer
  551. ENDIF
  552.  
  553. ### Candle lighting and Havdalah.  You should probably add candle lighting
  554. ### for other holidays besides Shabbat.  These just create calendar entries
  555. ### for Friday and Saturday.  Note:  You must set your latitude, longitude
  556. ### and possibly time zone for these to work properly!
  557.  
  558. REM Friday   CAL Candle lighting at [sunset(trigdate())-18]
  559. REM Saturday CAL Havdalah at [sunset(trigdate())+42]
  560.  
  561. #COLORS
  562. ##########################################################################
  563. #                                         #
  564. # This contains sample ANSI escape sequences for coloring messages.      #
  565. # It should work on an IBM PC with the ANSI.SYS driver, and on           #
  566. # other terminals which use the ANSI sequences.                          #
  567. #                                         #
  568. # This information was provided by Gail Gurman.
  569. #                                         #
  570. ##########################################################################
  571. # Colors - use Nrm to reset to normal text.
  572. SET Esc   CHAR(27)
  573.  
  574. SET Nrm   Esc + "[0m"
  575. SET Blk   Esc + "[0;30m"
  576. SET Red   Esc + "[0;31m"
  577. SET Grn   Esc + "[0;32m"
  578. SET Ylw   Esc + "[0;33m"
  579. SET Blu   Esc + "[0;34m"
  580. SET Mag   Esc + "[0;35m"
  581. SET Cyn   Esc + "[0;36m"
  582. SET Wht   Esc + "[0;37m"
  583. SET Gry   Esc + "[30;1m"
  584. SET BrRed Esc + "[31;1m"
  585. SET BrGrn Esc + "[32;1m"
  586. SET BrYlw Esc + "[33;1m"
  587. SET BrBlu Esc + "[34;1m"
  588. SET BrMag Esc + "[35;1m"
  589. SET BrCyn Esc + "[36;1m"
  590. SET BrWht Esc + "[37;1m"
  591.  
  592. # Examples
  593. REM MSG A [Blu]blue[Nrm] reminder.
  594. REM MSG [Red]%"A red reminder%" safe to use in the calendar mode.[Nrm]
  595.  
  596. # Here is an example of how to use msgprefix() and msgsuffix().  These
  597. # will highlight priority-0 reminders in bright red,
  598. # priority-2500 in red, and priority-7500 in blue.  All others
  599. # will be in the normal colors
  600. FSET msgprefix(x) iif(x==0, BrRed, x==2500, Red, x==7500, Blu, Nrm)
  601.  
  602. # Don't forget to return to normal color set at the end of reminder!
  603. FSET msgsuffix(x) Nrm
  604.  
  605. # The next examples are great for putting right at the end of the reminder
  606. # file.  They make queued reminders more eye-catching when they pop up.
  607. FSET msgprefix(x) char(13,10,13,10)+"******************"+char(13,10,13,10)
  608. FSET msgsuffix(x) char(13,10)+"******************"+char(13,10,13,10)
  609.