home *** CD-ROM | disk | FTP | other *** search
/ PDA Software Library / pdasoftwarelib.iso / PSION / 1997 / 969.ZIP / HOL.TXT < prev    next >
Encoding:
Text File  |  1997-03-24  |  17.6 KB  |  506 lines

  1. * HOL - calculate holidays and write to agenda file
  2.  
  3. HOL is a program for the Psion 3a, 3c and Siena that can be configured
  4. to calculate many holidays and write them to your agenda.
  5.  
  6. The program reads a holiday definition file, calculates dates for
  7. holidays according to the file, and writes the holidays to an agenda
  8. file. The user interface allows you to select which configured holidays
  9. to actually use, which years to calculate for, and preview the
  10. calculated dates on the screen before writing them to the agenda file.
  11.  
  12. Holidays can be defined relative to a fixed date (e.g. New Years Day), 
  13. a fixed Hebrew date (e.g. Passover), a fixed Islamic date (e.g. the
  14. Islamic New Year's day), a specific weekday (e.g. Midsommardagen; 1st
  15. Saturday after June 20th), Easter, or selected among several dates
  16. depending on a condition.
  17.  
  18. Style and year symbol can be specified generally and/or for each holiday. 
  19. The holidays are written to the agenda file as untimed day entries in
  20. the default time slot or as anniversaries. Some holidays can be written 
  21. as repeating entries.
  22.  
  23. Holiday definition files for Sweden, USA, Holland, Argentina, Uruguay,
  24. Norway, Finland, Germany, the Church of Ireland, France, the Church
  25. in Wales, Denmark, UK and Hebrew holidays are included.
  26. Examples of Islamic holidays are also included.
  27.  
  28.  
  29. * If you are upgrading...
  30.  
  31. If you already have version 1 of HOL installed you need to know this:
  32.  
  33.  o HOL has become an OPA that must be installed with Psion-I to be used.
  34.  o The directory for HOL-files and HOL.RSC has been changed to \HOL\.
  35.  
  36.  
  37. * Quick quide
  38.  
  39. ** Installation
  40.  
  41. This assumes that you have PsiWin.
  42.  
  43. 1) Unzip the archive with directories on the PC. (Use "PKUNZIP -d" or
  44.    check "Use Directory Names" in WinZip.)
  45.  
  46. 2) In PsiWin, drag the unzipped APP and HOL directories to the root
  47.    directory ("\") on the Psion. (This will copy HOL.OPA and HOLEDIT.ALS
  48.    to the APP directory and all holiday definitions files to \HOL\.)
  49.    
  50. 3) Install HOL.OPA on the Psion system screen with Psion-I.
  51.  
  52.  
  53. ** Using the program
  54.  
  55. 1) Exit the Agenda program if it has your agenda file open. 
  56.  
  57. 2) Select a file under the HOL icon with your country code and start
  58.    the program. 
  59.  
  60. 3) Preview holidays with Psion-P or write to the agenda file with 
  61.    Psion-W. The default settings will write all holidays for the current
  62.    year, using repeating entries if possible. 
  63.  
  64.  
  65. ** Uninstallation
  66.  
  67. 1) Remove HOL from the system screen with Psion-/
  68.  
  69. 2) Delete HOL.OPA and HOLEDIT.ALS from the \APP\ directory.
  70.  
  71. 3) Delete the \HOL\ directory and all its contents.
  72.  
  73.  
  74. * Detailed usage instructions
  75.  
  76. 1) Install the files:
  77.    - Copy HOL.OPA to \APP\. Install it from the system screen with 
  78.      Psion-I.
  79.    - Copy *.HOL files to \HOL\. 
  80.    - Optionally, copy HOL.RSC to \HOL\. This is the help text for HOL.
  81.    - Optionally, copy HOLEDIT.ALS to \APP\. Install it from the system 
  82.      screen with Psion-I if you want to create or edit *.HOL files.
  83.  
  84. 2) Examine the *.HOL files with a text editor, e.g. HOLEDIT, to see if
  85.    one suits you. If not, you can modify or create one with guidance
  86.    from EXAMPLE.HOL and the configuration section below.
  87.  
  88. 3) Start the program and open the *.HOL file. All holidays that are 
  89.    defined in the file will be listed on the screen with the style and
  90.    year-symbol specified in the file. The listing can be scrolled with
  91.    PgUp, PgDn, Home, End and arrow keys.
  92.  
  93. 4) Initially all holidays are selected to be written to the agenda file. 
  94.    This is shown with a '*' on each row. Select or deselect holidays
  95.    with Psion-M, Psion-U, Psion-N, Psion-T or the SPACE-key. 
  96.    
  97.    Psion-N selects all holidays that can't be written to the agenda as
  98.    repeating entries. See "How to use repeating entries" below for a tip
  99.    on how to use this.
  100.  
  101. 5) Optionally, calculate and preview the dates with Psion-P. See below
  102.    for information about the dialog box. The dates will be listed on the
  103.    screen. Press ESC to cancel the listing or any other key to
  104.    temporarily pause the listing.
  105.  
  106. 6) Calculate and write the dates to an agenda file with Psion-W. Select
  107.    an agenda file to write to. See below for more information about the
  108.    dialog box. To be safe, accept the offer to make a backup copy of the
  109.    agenda file. The dates will be listed on the screen as they are
  110.    written to the file. Press any key to cancel.
  111.  
  112.  
  113. ** The "Preview/Write holidays" dialog box
  114.  
  115. When you preview or write holidays a dialog box be shown where you:
  116.  
  117.  o Enter a year range to calculate dates for. 
  118.  
  119.  o Select whether HOL should try to use repeating entries ("If
  120.    possible") or not ("No"). See the next section for information about
  121.    when it is possible to use repeating entries.
  122.  
  123.  o Select whether the Agenda program should show all occurrences of
  124.    repeating entries or only the next outstanding occurrence. This
  125.    corresponds to the "Show"-line in the "Repeat entry" dialog box in
  126.    the Agenda program. If you selected not to use repeating entries this
  127.    information will be ignored.
  128.  
  129.  o Select whether repeating entries should repeat forever or until the
  130.    end of the year range. If you selected not to use repeating entries
  131.    this information will be ignored.
  132.  
  133.  o Select an agenda file (only in the "Write holidays" dialog).
  134.  
  135.  
  136. ** How to use repeating entries.
  137.  
  138. One of the many useful features of the Psion Agenda program is the
  139. ability to make an entry repeat at various intervals. An entry can for
  140. example be set to repeat on a specific date of the year or on the first,
  141. second, third, fourth or last occurrence of a weekday in a month.
  142.  
  143. Many holidays or special dates that we want to enter into our agenda
  144. file can in fact be made into repeating entries, e.g. New Years Day and
  145. Mother's Day. HOL can be used to write these repeating entries under
  146. certain conditions.
  147.  
  148. To be able to write a holiday as a repeating entry, the holiday must be
  149. specified in the holiday file with only one of these directives:
  150.  
  151.   o FIX(m,d)      - Meaning a fixed day D of month M in a year.
  152.                     E.g. FIX(1,1) is January 1st (New Years Day).
  153.                     
  154.   o FLOAT(m,wd,n) - Meaning the N'th weekday WD of month M, where N is
  155.                     1,2,3,4 or -1. E.g. FLOAT(5,0,2) is the second Sunday of
  156.                     June (Mother's Day).
  157.  
  158. (See the end of this file for more information about holiday files and
  159. directives.)
  160.  
  161. When you preview or write holidays you can tell HOL to write repeating
  162. entries "If possible". This means that if a holiday is specified using
  163. FIX or FLOAT as shown above, HOL will write the holiday once and make it
  164. a repeating entry. The holiday will be written for the first year in the
  165. specified year range.
  166.  
  167. The easiest way to use repeating entries is to accept the defaults in
  168. the "Write holidays" dialog box. This will give you repeating entries
  169. that are shown all years within the year range. 
  170.  
  171. If you prefer to have repeating entries repeat forever, I suggest you 
  172. do the following when using HOL on an agenda file for the first time:
  173.  
  174. 1) Mark all holidays with Psion-M
  175.  
  176. 2) In the "Write holidays" dialog box, enter a year range. Accept the
  177.    default to use repeating entries if possible.
  178.    
  179. Holidays will now be written for the specified year range, with some
  180. holidays entered only on the first year in the range as repeating
  181. entries.
  182.  
  183. The next time you use HOL on the same agenda file (when the first
  184. year range has passed) I suggest you:
  185.  
  186. 1) Mark holidays that can't be made to repeat with Psion-N. (The others
  187.    are already in the agenda file as repeating entries)
  188.  
  189. 2) Specify a new year range in the dialog box. 
  190.  
  191.  
  192. * License
  193.  
  194. This program is free software under the terms of the GNU General Public 
  195. License. See the file COPYING.TXT for details.
  196.  
  197. HOL.OPL was written by Odd Gripenstam <gripenstamol@decus.se>. 
  198. Calendar and holiday routines are translated from lisp code found in
  199. GNU Emacs.
  200.  
  201. Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Free Software
  202. Foundation, Inc.
  203. Copyright (C) 1996 Odd Gripenstam
  204.  
  205.  
  206. * Acknowledgements
  207.  
  208. The help compiler and the code that accesses the help was written by 
  209. Jezar at Psion. It is available as HELPKIT1.ZIP in the archives. 
  210. Contact me if you can't find it.
  211.  
  212. I would like to thank Patrick Wildenborg, Horacio Hirsch, Mikael Tham,
  213. Knut Utne Hollund, Erlend Leganger, Jokitulppo Vesa, Holger Pfaff,
  214. Brian Mayne, Denis Casanova, Ian Day, Ole Carsten Pedersen, Klaus
  215. Singvogel, Paul Everington, Edward Arnowitz, Awi Szotten, David M. Kurtz 
  216. for contributing holiday definitions.
  217.  
  218.  
  219. * Feedback
  220.  
  221. No registration is necessary, but I would appreciate if you send me a
  222. mail or postcard if you use the program.  If you try the program and 
  223. *don't* use it, please send me an e-mail and tell me why.
  224.  
  225. If you write or modify a holiday file, please send it to me and I will
  226. include it in the distribution so more people can benefit from your
  227. effort.
  228.  
  229. You can reach me at:
  230.  
  231.   E-mail:      
  232.                 gripenstamol@decus.se
  233.   Snail-mail:  
  234.                 Odd Gripenstam
  235.                 Skagersvagen 14
  236.                 120 38 ARSTA
  237.                 SWEDEN
  238.  
  239.  
  240. * Files in the distribution
  241.  
  242. This distribution should contain:
  243.  
  244.   \APP\HOL.OPA          The program
  245.   \APP\HOLEDIT.ALS      Text editor alias for \HOL\*.HOL 
  246.   \HOL\EXAMPLE.HOL      Example holiday file
  247.   \HOL\AR.HOL           Argentinian holidays
  248.   \HOL\COFI.HOL         Church of Ireland holidays
  249.   \HOL\CIWC.HOL         Church in Wales holidays, Welsh/Cymraeg
  250.   \HOL\CIWE.HOL         Church in Wales holidays, English
  251.   \HOL\DE.HOL           German holidays
  252.   \HOL\DK.HOL           Danish holidays
  253.   \HOL\FI.HOL           Finnish holidays
  254.   \HOL\FR.HOL           French holidays
  255.   \HOL\NL.HOL           Dutch holidays
  256.   \HOL\NO.HOL           Norwegian holidays
  257.   \HOL\SE.HOL           Swedish holidays
  258.   \HOL\UK.HOL           UK holidays
  259.   \HOL\US.HOL           US holidays
  260.   \HOL\UY.HOL           Uruguayan holidays
  261.   \HOL\ARUY.HOL         A mix of South American holidays
  262.   \HOL\HEBREW.HOL       Hebrew holidays
  263.   \HOL\ISLAMIC.HOL      Islamic holidays
  264.   \HOL\HOL.RSC          Compiled help text
  265.   HOL.OPL               Source code for the application
  266.   HOL.HLP               Help text source file
  267.   HOL.TXT               This file
  268.   HOLAPP.PIC            Icon for HOL.OPL
  269.   HOLEDIT.PIC           Icon for HOLEDIT.ALS
  270.   HOLCHANG.TXT          A history of changes to the files
  271.   COPYING.TXT           GNU General Public License
  272.  
  273.  
  274. * Translation
  275.  
  276. Unfortunately, the source file HOL.OPL is too big to be translated on
  277. the Psion. You can translate the file on a PC with the MS-DOS translator
  278. S3ATRAN, or you can split the file in two parts before copying it to the
  279. Psion and add a LOADM command to first part.
  280.  
  281.  
  282. * Other resources
  283.  
  284. Here are some other resources related to holidays and the Psion agenda.
  285. They are all available on the net. You can mail me if you have trouble
  286. finding a copy or if you know of a file that should be added to the
  287. list.
  288.  
  289. JBWHOL.ZIP      Calculates predetermined English and German holidays and 
  290.                 adds them to the agenda.
  291.                 
  292. FEIER10.ZIP     Calculates German holidays and adds them to the agenda.
  293.                 Probably configurable for other languages and holidays if 
  294.                 you make a few educated guesses about its data file format.
  295.  
  296. FTAG30.ZIP      Calculates and adds holidays related to easter and
  297.                 whitsun to the agenda. Includes OPL source.
  298.                 
  299. EASTER_E.ZIP    English translation of FTAG30.ZIP
  300.                 
  301. HOLI3A.ZIP      An agenda file with US holidays 1992-1997. 
  302.                 Some holidays are specified as repeating entries.
  303.  
  304. LOTSOHOL.ZIP    Agenda files with US holidays 1995-2000. 
  305.                 Some holidays are specified as repeating entries.
  306.  
  307. HOLI_UK.ZIP     Agenda file with UK holidays 1994-2005.
  308.  
  309.  
  310. * Configuration
  311.  
  312. Holidays are defined by writing a holiday definition file. 
  313. A holiday file is a text file with the file type .HOL. It contains
  314. directives to the HOL program on what holidays to calculate and how to
  315. write them to an agenda file.
  316.  
  317. The text in a holiday file consists of comments, keywords, punctuation
  318. characters and quoted strings. 
  319.  
  320. A comment is any text after an exclamation mark or the keyword REM up to
  321. the end of the current line. Keywords (e.g. STYLE) are not case
  322. sensitive. A quoted string is any text within double quotes (e.g. "H").
  323. A quoted string can not span lines. 
  324.  
  325. The file EXAMPLE.HOL explains the syntax with commented examples. Here
  326. is a more formal looking definition:
  327.  
  328. <directive> : 
  329.         <year-symbol-directive>
  330.         <style-directive>
  331.         <entry-type-directive>
  332.         <simple-holiday-directive>
  333.         <compound-holiday-directive>
  334.  
  335. <compound-holiday-directive> : 
  336.         { <local-directive-list> }
  337.  
  338. <local-directive-list> : 
  339.         <local-directive>
  340.         <local-directive-list local-directive>
  341.  
  342. <local-directive> : 
  343.         <year-symbol-directive>
  344.         <style-directive>
  345.         <alias-directive>
  346.         <entry-type-directive>
  347.         <simple-holiday-directive>
  348.  
  349. <year-symbol-directive> :
  350.         YEAR_SYMBOL = " <year-symbol> " ;
  351.  
  352. <style-directive> :
  353.         STYLE = <style-list> ;
  354.  
  355. <style-list> :
  356.         <style>
  357.         <style-list> , <style>
  358.  
  359. <style> :
  360.         NORMAL
  361.         BOLD
  362.         ITALIC
  363.         UNDERLINE
  364.  
  365. <alias-directive> :
  366.         ALIAS = <alias> ;
  367.  
  368. <entry-type-directive> :
  369.         ENTRY_TYPE = <entry-type> ;
  370.  
  371. <entry-type> :
  372.         IGNORE
  373.         UNTIMED
  374.         ANNIVERSARY
  375.  
  376. <simple-holiday-directive>:
  377.         " <holiday-name> " = <date-expression-list> ;
  378.  
  379. <date-expression-list> :
  380.         <date-expression>
  381.         <date-expression-list> <date-expression>
  382.  
  383. <date-expression> :
  384.         <simple-date-expression>
  385.         <flow-control>
  386.  
  387. <simple-date-expression> :
  388.         <date-setter> 
  389.         <date-modifier>
  390.  
  391. <date-setter> :
  392.         <alias>
  393.         FIX ( <value> , <value> )
  394.         HFIX ( <value>, <value> )
  395.         IFIX ( <value>, <value> )
  396.         FLOAT ( <value> , <value> , <negvalue> <opt-value>(opt) )
  397.         LAST ( <value> )
  398.         EASTER
  399.  
  400. <opt-value> : 
  401.         , <value>
  402.  
  403. <date-modifier> : 
  404.         + <value>
  405.         - <value>
  406.  
  407. <flow-control> :
  408.         DONEIF ( <condition-list> )
  409.         IF ( <condition-list> ) { <simple-date-expression> }
  410.         ELSEIF ( <condition-list> ) { <simple-date-expression> }
  411.         ELSE { <simple-date-expression> }
  412.         
  413. <condition-list> : 
  414.         <condition>
  415.         <condition-list> OR <condition>
  416.         NOT ( <condition-list> )
  417.  
  418. <condition> :
  419.         WEEKDAY ( <value> )
  420.         
  421. <negvalue> :
  422.         -(opt) <value>
  423.         
  424. <year-symbol>  = max one character.
  425. <alias>        = a word with characters A-Z, max 33 characters.
  426. <holiday-name> = a sequence of printable characters (except quote (")),
  427.                  max 254 characters. If the text contains %IY or %HY
  428.                  then those three characters will be replaced by 
  429.                  the Islamic or Hebrew year for the calculated date.
  430. <value>        = a positive number, digits 0-9
  431.  
  432.  
  433. Functions:
  434.  
  435. FIX(month, day)
  436.         Sets the date to day # DAY in month # MONTH. 
  437.         Day and month numbers start at 1.
  438.  
  439. HFIX(month, day)
  440.         Sets the date to day # DAY in Hebrew month # MONTH.
  441.         Day and month numbers start at 1 (month 1 = Nisan).
  442.         Month 13 is the last month of the year, i.e. Adar or
  443.         Adar II depending on whether it is a leap year or not.
  444.  
  445. IFIX(month, day)
  446.         Sets the date to day # DAY in Islamic month # MONTH.
  447.         Day and month numbers start at 1 (month 1 = Muharram).
  448.  
  449. FLOAT(month, weekday, n)
  450.         Sets the date to the date of the Nth WEEKDAY in month # MONTH.
  451.         Day and month numbers start at 1. N starts at 1. If N < 0 count 
  452.         N WEEKDAYs from the end of the month. WEEKDAY numbers are from 
  453.         0 (Sunday) to 6 (Saturday).
  454.  
  455. FLOAT(month, weekday, n, day)
  456.         Sets the date to the date of the Nth WEEKDAY on or before/after 
  457.         day # DAY in month # MONTH.
  458.         Day and month numbers start at 1. N starts at 1. If N < 0 count 
  459.         N WEEKDAYs before DAY MONTH, otherwise count N WEEKDAYs after 
  460.         DAY MONTH. WEEKDAY numbers are from 0 (Sunday) to 6 (Saturday).
  461.         
  462. LAST(month)
  463.         Sets the date to the date of the last day of month # MONTH.
  464.  
  465. EASTER
  466.         Sets the date to the date of Easter Sunday (non-orthodox).
  467.         
  468. DONEIF(condition)
  469.         If the condition is true then the rest of the current holiday
  470.         directive (up to ';') will not be used.
  471.         A condition is 'WEEKDAY(day)' or 'WEEKDAY(day) OR WEEKDAY(day)'
  472.         etc.
  473.  
  474. IF(condition) { simple-date-expression }
  475.         If the condition is true then the simple-date-expression will
  476.         be used. 
  477.  
  478. ELSEIF(condition) { simple-date-expression }
  479.         If the condition is true and no preceeding IF or ELSEIF condition
  480.         was true then the simple-date-expression will be used.
  481.  
  482. ELSE { simple-date-expression }
  483.         If no preceeding IF or ELSEIF condition was true then 
  484.         the simple-date-expression will be used.
  485.  
  486. WEEKDAY(weekday)
  487.         Can only be used in DONEIF, IF and ELSEIF.
  488.         Returns 'true' if the date is on the weekday specified as a
  489.         parameter. WEEKDAY numbers are from 0 (Sunday) to 6 (Saturday).
  490.         
  491. NOT(condition)
  492.         Can only be used in DONEIF, IF and ELSEIF.
  493.         Returns the opposite value of the condition.
  494.  
  495. * Limits
  496.  
  497. Line length in holiday file: 255 characters
  498. Number of holiday definitions: 101
  499. Number of aliases: 10
  500. Number of characters in an alias: 33
  501.  
  502.  
  503.  
  504.  
  505.  
  506.