home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / MKDATE12.ZIP / makedate.txt < prev   
Text File  |  2003-06-23  |  6KB  |  139 lines

  1.              "Makedate" Date Fixer for Searchlight, version 1.2
  2.                    http://home.covad.net/~wmcbrine/sl.html
  3.  
  4.                              Copyright (c) 2003
  5.                      William McBrine <wmcbrine@covad.net>
  6.  
  7.              Written using the Searchlight Programmer's Library
  8.               Portions Copyright (c) 1994 Searchlight Software
  9.  
  10.  
  11. :::: MAKEDATE.EXE ::::
  12.  
  13. I wrote this program primarily to deal with Y2K bugs in SLMAIL.EXE and
  14. NETMAIL.EXE (hereafter collectively referred to as "SLMAIL"), though I'd
  15. been thinking about doing something like this anyway to ease the transition
  16. from one version of Searchlight to another.
  17.  
  18. The problem is with the way dates with a year of 2000 or later are
  19. represented in Searchlight -- this has changed in SL 5.x. In the new
  20. system, the year 2000 is stored as 100. But SLMAIL fails to export messages
  21. with such a year; and when importing, it stores the year as 0, which shows
  22. up as "1900" in SL 5.x. (For more on this, see the section "Dates in
  23. Searchlight".)
  24.  
  25. Makedate allows you to alter the dates in the Searchlight message base,
  26. switching between the "old" and "new" formats at will. The switch is based
  27. on a fixed window: When converting from new to old, any year greater than
  28. 100 has 100 subtracted; and when converting from old to new, any year less
  29. than 80 has 100 added. This should suffice to keep SLMAIL running for
  30. another 80 years. (Searchlight 5.x itself has other date problems,
  31. however, starting in 2076.)
  32.  
  33. For exports, the procedure is as follows:
  34.  
  35.  makedate old subname
  36.  slmail e subname -g wherever
  37.  makedate new subname
  38.  
  39. where "subname" is the name of the conference, and the second line is just
  40. an example. The "old" and "new" parameters may be abbreviated to "o" or
  41. "n". The first invocation changes all dates to a form SLMAIL can recognize;
  42. then you call SLMAIL as usual. The final invocation of makedate restores
  43. the dates to the new format.
  44.  
  45. When importing, you would also use makedate afterwards:
  46.  
  47.  slmail i subname -g wherever
  48.  makedate new subname
  49.  
  50. to avoid the appearance of "1900" in the message base.
  51.  
  52. Instead of specifying each conference separately, you can provide a list to
  53. Makedate:
  54.  
  55.  makedate new @listfile
  56.  
  57. This is similar to SLMAIL's "@" file option, but in this case, the list
  58. file is a plain text list of conferences, one per line, rather than a list
  59. of commands. The standard Searchlight "MAIN.SUB"-type file may be used for
  60. this purpose.
  61.  
  62. Aside from working around bugs in SLMAIL, Makedate could also be useful if
  63. you're upgrading from an older version of Searchlight to 5.0 or later, and
  64. have year-2000 dates in your message base.
  65.  
  66. Makedate will also work with older (< 5.0) versions of Searchlight, but in
  67. that case, it will refuse to convert to the new format, since that format
  68. is not well understood by those versions of SL. (The year 2000 would appear
  69. as "100".) It will convert from the new format to the old, if you have some
  70. reason to do that (e.g., downgrading your SL setup).
  71.  
  72.  
  73. ::: DATES IN SEARCHLIGHT ::::
  74.  
  75. The Searchlight internal date format uses one unsigned binary byte to
  76. represent the year, as well as one byte each for the month and day. In
  77. versions prior to 5.0, the year was stored as (year mod 100); that is (in
  78. decimal terms), as the last two digits. 1999 is stored as 99, and 2000 will
  79. be stored (and displayed) as 00.
  80.    
  81. In SL 5.0, the displayed year was changed to use four digits, and the
  82. internal date was redefined as (year - 1900). Thus, the year 2000 will be
  83. stored as 100. (For years between 1900 and 2000, the definitions are
  84. equivalent.) This redefinition has value, because it allows the year value
  85. to be unambiguous; but it also breaks some things, like the old version of
  86. the strdate() function from the Searchlight Programmers' Library, which
  87. will now show "100" for the year 2000. Furthermore, it limits the maximum
  88. year value to 1900 + 255, or 2155; but before that, MSDOS itself will run
  89. out of time, at the end of 2099.
  90.    
  91. The routine which displays the day of the week in Searchlight works by
  92. comparing the date with a known day, via the datediff() function, and using
  93. that value mod 7 as the index to a string array. The date it uses is
  94. 1-1-87. Unfortunately, the datediff() routine only returns a 16-bit signed
  95. integer, which means that it breaks after 32767 days. Hence, in Searchlight
  96. 5.x, the day of the week shows up incorrectly after 9-17-2076. (It prints
  97. things like "December" where it should say "Wed".) In earlier versions, it
  98. breaks much sooner -- on 1-1-2000. Granted, this is purely a cosmetic
  99. problem.
  100.    
  101. Most Y2K problems with SL 4.5 will be cosmetic; e.g., the day of the week
  102. will be printed incorrectly.
  103.  
  104. In previous versions of the above text, I followed that with "However,
  105. things will work more smoothly all around if you upgrade to SL 5.x before
  106. the year 2000." I regretfully retract that statement, given the evident Y2K
  107. bugs in SLMAIL -- which, ironically, should NOT affect SL 4.5 systems.
  108.  
  109.  
  110. :::: HISTORY ::::
  111.  
  112. 1.2  - 2003/06/23:
  113.  
  114. - Oops! The source code released with 1.1b couldn't actually be compiled, 
  115.   because it contained references to units that were neither included, nor 
  116.   part of the Searchlight Programmer's Library.
  117.  
  118. - Moved sublistinit() call out of onesub() so it's only called once, even
  119.   when processing multiple conferences.
  120.  
  121. 1.1b - 2003/06/13:
  122.  
  123. - Changed license, released source; updated Internet addresses.
  124.  
  125. 1.1  - 2000/01/14:
  126.  
  127. - Added list file capability and documentation.
  128.  
  129. 1.0  - 2000/01/13:
  130.  
  131. - First release. No docs. :-)
  132.  
  133.  
  134. :::: LICENSE AGREEMENT ::::
  135.  
  136. This program is free software, now released under the GPL.  See "COPYING"
  137. for terms.  However, note that the GPL does not cover the Searchlight
  138. Programmer's Library.
  139.