home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / oplexamp / AGENDFMT.TXT < prev    next >
Text File  |  1993-03-12  |  4KB  |  149 lines

  1. Msg # 431 of 437                 Date: Tue  9/03/93, 17:03  [I]
  2. From: PAUL HARGREAVES            Read: 0 times
  3.  
  4.      To: SPENCER DAVIES
  5. Subject: AGENDA FILE FORMAT. 1of2
  6.  
  7. SD>Where can I find out about the format of the files created in Agenda?
  8. SD>I need to write a program for the Atari ST to use these files produced on
  9. SD>my Series 3 but I am having little success discovering the header blocks
  10. SD>format as well as the entries header blocks.
  11.  
  12. The following is the file spec for the Agenda file format. I'll also
  13. post an OPL program that can read Agenda files as soon as I can find it.
  14.  
  15. Iechyd da!
  16. Paul.
  17.  
  18. ----------> Cut Here <----------
  19.  
  20.                Series 3 Agenda file format
  21.  
  22. Agenda field structure
  23.  
  24.    Integer:    DayNumber
  25.    Integer:    Duration
  26.    Integer:    Time
  27.    Integer:    AlarmTime
  28.    String:     Text
  29.  
  30.  
  31. Timed and Untimed items
  32.  
  33. -  DayNumber is the number of days since 1/1/1900 (=day
  34.    0). The first legal day is 1/1/1980, the last legal
  35.    day is 31/12/2049.
  36.  
  37. -  Duration, Time, and AlarmTime are all stored in
  38.    minutes.
  39.  
  40. -  The MSB of Time (i.e. 8000 Hex) is a flag that
  41.    indicates whether the item is Timed or Untimed. If the
  42.    MSB is set then the item is Untimed, if its clear then
  43.    the item is Timed.
  44.  
  45. -  To extract the time from the Time field it must be
  46.    ANDed with 7fff Hex to remove the MSB (i.e. Timed and
  47.    Untimed indicator).
  48.  
  49. -  The LSB of Duration (i.e. 1 Hex) is a flag that
  50.    indicates whether the item has an alarm attached. If
  51.    the LSB is set then no alarm is attached, if its clear
  52.    then an alarm is attached.
  53.  
  54. -  To extract the duration from the Duration field,
  55.    divide by 2 (thus removing the LSB and shifting down
  56.    the duration).
  57.  
  58. -  If the item is untimed then the Time field contains
  59.    the day note slot number i.e. 1 to n and its MSB must
  60.    be set (i.e. OR in 8000 Hex). The Duration field
  61.    contains zero if an alarm is attached or one if no
  62.    alarm is attached.
  63.  
  64. -  The end time of a timed item i.e. Time+Duration, must
  65.    be less than 1440 (24*60) minutes.
  66.  
  67. -  For timed items the AlarmTime is an alarm pre time and
  68.    is calculated as follows:
  69.  
  70.    Pre time to Agenda internal alarm format:
  71.  
  72.           (23*60+59) + Alarm pre time - Time
  73.  
  74.    Agenda internal alarm format to pre time:
  75.  
  76.           Time - (23*60+59) + AlarmTime
  77.  
  78. -  For untimed items the AlarmTime is calculated as
  79.    follows:
  80.  
  81.    Pre time to Agenda internal alarm format:
  82.  
  83.           (Days previous * (24*60)) - ((23*60+59) - Alarm time)
  84.  
  85.    Agenda internal alarm format to days previous:
  86.  
  87.           AlarmTime / (24*60)
  88.  
  89.    Agenda internal alarm format to alarm time:
  90.  
  91.           (23*60+59) - (AlarmTime modulus (24*60))
  92.  
  93.  
  94. -  If the item does not have an alarm the AlarmTime field
  95.    should contain -1.
  96.  
  97. -  The Text field is stored as a leading byte count
  98.    string and its length must be less than 64 characters.
  99.  
  100.  
  101. ToDo items
  102.  
  103. -  ToDo items have a DayNumber of 65535 (ffff Hex), and
  104.    must be stored as timed items and so the MSB of the
  105.    Time field must be clear.
  106.  
  107. -  The Time field contains the item priority i.e. 1 to 9.
  108.  
  109. -  The Duration field contains a secondary key 0 to n,
  110.    which orders the ToDo items within priority.
  111.  
  112. -  ToDo items cannot have alarms attached.
  113.  
  114.  
  115.  
  116. Repeat items
  117.  
  118. -  Timed and Untimed repeat items are stored in exactly
  119.    the same way as normal timed and untimed items, except
  120.    that they have a DayNumber of 65534 (fffe Hex).
  121.  
  122. -  The specific repeat details are stored at the end of
  123.    the Text field and have the following format:
  124.  
  125.    Byte:      Type
  126.    Byte:      Interval
  127.    Integer:   StartDayNumber
  128.    Integer:   EndDayNumber
  129.  
  130. -  The Type field can take the following values:
  131.  
  132.    Repeat Yearly                = 0
  133.    Repeat Monthly By Date       = 1
  134.    Repeat Monthly By Day        = 2
  135.    Repeat Weekly                = 3
  136.    Repeat Daily                 = 4
  137.    Repeat Workdays              = 5
  138.  
  139.  
  140. -  The StartDayNumber and EndDayNumber are stored as the
  141.    number of days since 1/1/1900 (=day 0).
  142.  
  143. -  Setting the EndDayNumber field to zero will mean the
  144.    item will repeat forever.
  145. ---
  146.   SLMR 2.0  The best prophet of the future is the past.
  147. --- FiFo V2.1o [IOSmail 0.89]
  148.  * Origin: -=- <FORTRESS> BBS {UK} -=- [081-317-3158] -=- (2:440/105)
  149.