home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / agenda / AGENDA.DOC next >
Text File  |  1992-05-04  |  4KB  |  125 lines

  1.                Series 3 Agenda file format
  2.  
  3. Agenda field structure
  4.  
  5.    Integer:    DayNumber
  6.    Integer:    Duration
  7.    Integer:    Time
  8.    Integer:    AlarmTime
  9.    String:     Text
  10.  
  11.  
  12. Timed and Untimed items
  13.  
  14. -  DayNumber is the number of days since 1/1/1900 (=day
  15.    0). The first legal day is 1/1/1980, the last legal
  16.    day is 31/12/2049.
  17.  
  18. -  Duration, Time, and AlarmTime are all stored in
  19.    minutes.
  20.  
  21. -  The MSB of Time (i.e. 8000 Hex) is a flag that
  22.    indicates whether the item is Timed or Untimed. If the
  23.    MSB is set then the item is Untimed, if its clear then
  24.    the item is Timed.
  25.  
  26. -  To extract the time from the Time field it must be
  27.    ANDed with 7fff Hex to remove the MSB (i.e. Timed and
  28.    Untimed indicator).
  29.  
  30. -  The LSB of Duration (i.e. 1 Hex) is a flag that
  31.    indicates whether the item has an alarm attached. If
  32.    the LSB is set then no alarm is attached, if its clear
  33.    then an alarm is attached.
  34.  
  35. -  To extract the duration from the Duration field,
  36.    divide by 2 (thus removing the LSB and shifting down
  37.    the duration).
  38.  
  39. -  If the item is untimed then the Time field contains
  40.    the day note slot number i.e. 1 to n and its MSB must
  41.    be set (i.e. OR in 8000 Hex). The Duration field
  42.    contains zero if an alarm is attached or one if no
  43.    alarm is attached.
  44.  
  45. -  The end time of a timed item i.e. Time+Duration, must
  46.    be less than 1440 (24*60) minutes.
  47.  
  48. -  For timed items the AlarmTime is an alarm pre time and
  49.    is calculated as follows:
  50.  
  51.    Pre time to Agenda internal alarm format:
  52.  
  53.           (23*60+59) + Alarm pre time - Time
  54.  
  55.    Agenda internal alarm format to pre time:
  56.  
  57.           Time - (23*60+59) + AlarmTime
  58.  
  59. -  For untimed items the AlarmTime is calculated as
  60.    follows:
  61.  
  62.    Pre time to Agenda internal alarm format:
  63.  
  64.           (Days previous * (24*60)) - ((23*60+59) - Alarm time)
  65.  
  66.    Agenda internal alarm format to days previous:
  67.  
  68.           AlarmTime / (24*60)
  69.  
  70.    Agenda internal alarm format to alarm time:
  71.  
  72.           (23*60+59) - (AlarmTime modulus (24*60))
  73.  
  74. -  If the item does not have an alarm the AlarmTime field
  75.    should contain -1.
  76.  
  77. -  The Text field is stored as a leading byte count
  78.    string and its length must be less than 64 characters.
  79.  
  80.  
  81. ToDo items
  82.  
  83. -  ToDo items have a DayNumber of 65535 (ffff Hex), and
  84.    must be stored as timed items and so the MSB of the
  85.    Time field must be clear.
  86.  
  87. -  The Time field contains the item priority i.e. 1 to 9.
  88.  
  89. -  The Duration field contains a secondary key 0 to n,
  90.    which orders the ToDo items within priority.
  91.  
  92. -  ToDo items cannot have alarms attached.
  93.  
  94.  
  95.  
  96. Repeat items
  97.  
  98. -  Timed and Untimed repeat items are stored in exactly
  99.    the same way as normal timed and untimed items, except
  100.    that they have a DayNumber of 65534 (fffe Hex).
  101.  
  102. -  The specific repeat details are stored at the end of
  103.    the Text field and have the following format:
  104.  
  105.    Byte:      Type
  106.    Byte:      Interval
  107.    Integer:   StartDayNumber
  108.    Integer:   EndDayNumber
  109.  
  110. -  The Type field can take the following values:
  111.  
  112.    Repeat Yearly                = 0
  113.    Repeat Monthly By Date       = 1
  114.    Repeat Monthly By Day        = 2
  115.    Repeat Weekly                = 3
  116.    Repeat Daily                 = 4
  117.    Repeat Workdays              = 5
  118.  
  119.  
  120. -  The StartDayNumber and EndDayNumber are stored as the
  121.    number of days since 1/1/1900 (=day 0).
  122.  
  123. -  Setting the EndDayNumber field to zero will mean the
  124.    item will repeat forever.
  125.