home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1997 January / CD_shareware_1-97.iso / DOS / UTIL / DTCKP151.ZIP / DATECHK.DOC < prev    next >
Encoding:
Text File  |  1996-10-02  |  17.1 KB  |  400 lines

  1.  
  2.                            Wasted Lights Software
  3.                                   Presents
  4.  
  5.                           Date Check Pro ver 1.51
  6. _______________________________________________________________________________
  7.  
  8.  
  9.                           What is Date Check Pro?
  10.  
  11.         Date Check was originally a program to only perform daily,
  12.         weekly, and monthly maintenance.  It finally evolved WAY beyond
  13.         it's original purpose to include many professional operations.
  14.         After Date Check version 7.20, it finally warranted a fairly new
  15.         algorithm, and a new name.  Date Check Pro has finally been born.
  16.  
  17.  
  18.                           How do I use Date Check?
  19.  
  20.         Date Check can be used in several modes of operation.  Normal users
  21.         only need to concern themselves with the first two.
  22.  
  23.         1. Single Home Computer User/Normal Maintenance.
  24.             This mode is the default.  It is used to start any of the other
  25.             modes, or used by itself.  If you put the program as the last (or
  26.             near last) line in your autoexec.bat, it will look at the date, and
  27.             depending on certain conditions, will perform special batch files
  28.             for you.
  29.  
  30.             These batch files must be called:
  31.  
  32.             DAILY.BAT               For once-a-day maintenance
  33.             WEEKLY.BAT              For once-a-week maintenance
  34.             MONTHLY.BAT             For once-a-month maintenance
  35.             YEARLY.BAT              For once-a-year maintenance
  36.             MONDAY.BAT              To execute on Monday
  37.             TUESDAY.BAT             To execute on Tuesday
  38.             WEDNSDAY.BAT            To execute on Wednesday
  39.             THURSDAY.BAT            To execute on Thursday
  40.             FRIDAY.BAT              To execute on Friday
  41.             SATURDAY.BAT            To execute on Saturday
  42.             SUNDAY.BAT              To execute on Sunday
  43.             MM-DD.BAT               To execute on MM/DD (MM being a month,
  44.                                     DD being a day.  Ex. 01-01.BAT for Jan
  45.                                     1st, 02-14.BAT for Valentines day, and
  46.                                     so on...
  47.             USER.BAT                Will execute on a User-Defined
  48.                                     Interval... This is either configured
  49.                                     when you first run Date Check, or by
  50.                                     using the /Config option (Explained
  51.                                     later...)
  52.  
  53.             These will execute only once on the specified day, or interval.
  54.             Very convenient for Virus Checkers, Hard Disk Defraggers, etc...
  55.  
  56.             *NOTE* IF /PATH OPTION IS NOT SPECIFIED ON THE COMMAND LINE, OR
  57.             IS NOT SAVED IN THE INI FILE, PROGRAM DATA FILE WILL BE DEPOSITED
  58.             IN THE DIRECTORY YOU START THE PROGRAM FROM.  BATCH FILES AND
  59.             EXECUTABLE MUST BE IN THE PATH.  SEMAPHORE FILES WILL ALSO BE IN
  60.             THE DIRECTORY THE PROGRAM WAS STARTED FROM.
  61.  
  62.             The options available in this mode are:
  63.  
  64.                 /SEM        Starts the program in mode two.
  65.                 /CHECK      Assumes all appropriate maintenance needs done.
  66.                             Good for verifying batch files are working properly.
  67.                 /AUTO       Performs all maintenance unattended.
  68.                 /CONFIG     Re-configures user defined interval
  69.                 /NOHOLIDAY  Disables holiday greetings
  70.                 /MAKE       Starts the program in mode three
  71.                 /LIST       Starts the program in mode four
  72.                 /NOWRITE    Disables writing to the DATECHK.DAT file.
  73.                             Forces the program to run again the next time
  74.                             it's executed.  Debugging/Special Purpose only!
  75.                 /PATH <Dir> Forces Date Check to look in <dir> for all file
  76.                             transactions except for DATECHK.INI (Which MUST be
  77.                             in the same Directory as Date Check)
  78.                 /SAVE       Saves Options in DATECHK.INI
  79.                 /KILL       Kills Saved Options
  80.  
  81.         2. Semaphore Mode/BBS Mode
  82.             This mode was designed for BBS Sysops to use with front-end
  83.             mailer events and BBS events.  Instead of executing the batch
  84.             files in the previous section, It creates semaphore files with the
  85.             ".DCS" extension, and named by the same name as the batch files
  86.             were.  Switches available in this mode are:
  87.  
  88.                 /CONFIG     Re-configures user defined interval.
  89.                 /CHECK      Assumes all appropriate maintenance needs done;
  90.                             Good for verifying semaphore writes.
  91.                 /NOWRITE    Disables writing to the DATECHK.DAT file.
  92.                             Forces the program to run again the next time
  93.                             it's executed.  Debugging/Special Purpose only!
  94.                 /PATH <Dir> Forces Date Check to look in <dir> for all file
  95.                             transactions except for DATECHK.INI (Which MUST be
  96.                             in the same Directory as Date Check)
  97.                 /SAVE       Saves Options in DATECHK.INI
  98.                 /KILL       Kills Saved Options
  99.  
  100.         3. Make Holiday list mode
  101.             This makes the list of things to say in normal mode on
  102.             specified days.  For example, it defines December 25 to say "Merry
  103.             Christmas".  To see the current list, use the /LIST option.
  104.  
  105.         4. List Holidays mode
  106.             Creates a text file with the current list of holidays.
  107.         
  108.                         Date Check Zips
  109.         Like a lot of programmers have been doing lately, I have
  110.         taken to giving naming rules to my ZIP files.
  111.  
  112.         DTCKP (Version).zip
  113.         In other words, you should have received this zip as
  114.         DTCKP100.ZIP
  115.  
  116.  
  117.                                  Revision History
  118.  
  119.         *Original Date Check*
  120.         ver .5 ßeta
  121.             Original version of program... One word... SUCKED!!!  It could only
  122.         handle monthly and daily maintenance, and had a few glitches in the
  123.         algorithm.
  124.  
  125.         ver .99 ßeta
  126.             Added Weekly Maintenance.  Also added a few diagnostic options, to
  127.         check for bugs more efficiently.  Problem with weekly maintenance,
  128.         I had to use someone else's code until I could correct it.  Didn't
  129.         want to, because of possible copyright infringements.
  130.  
  131.         ver 1.00
  132.             Finally perfected weekly code.  Was informed by someone that the
  133.         year 2000 was NOT a leap year, although it is divisible by 4.  Created
  134.         code to count up days, and then get the modulus for the weekday.
  135.         Optimized the code so some delays were taken care of.  This is about
  136.         as best as the program can get. Decided to release it to public.
  137.  
  138.         ver 1.01
  139.             Ok, so it wasn't the best... I fixed a bug for when Datechk would
  140.         be first run, it would give me an overflow error.  I also
  141.         compressed the date storage. (Ok, so it was small to begin with...
  142.         I did it just to see if I could do it...) I reduced the file from 12
  143.         bytes to 3 bytes.  No big deal, but I intend to use the technology
  144.         in other programs I have.  The program will automatically erase and
  145.         update the old DATE.REC.
  146.  
  147.         ver 1.02        
  148.             I optimized the routines, reduced code from constants to loops, and
  149.         reduced the DATE.REC to 2 bytes... (Yes I'm obsessed with trying to 
  150.         see what I can do.)
  151.  
  152.         ver 1.03
  153.             Further optimization, and Found out that the year 2000 is, in fact,
  154.         a leap year.  Would not have run into problems till year 2000, but
  155.         I hate a messy program.
  156.  
  157.         ver 1.04
  158.             Added capability to choose whether or not to execute the batch
  159.         files
  160.  
  161.         ver 2.00
  162.             I've optimized ALL of the routines to the best of my ability for
  163.         speed.  I've also put most of the key options in CONST statements, for
  164.         ease in customizing.  I've decided that I would finally just release
  165.         this program into the public domain, considering that
  166.  
  167.         1. No one sent me money (Damn!!!)
  168.         2. I have been mainly programming this for myself
  169.  
  170.         Because of this, I've also decided that I'd also release the
  171.         QuickBasic source code, and you can customize the program for you
  172.         own needs.  I will release a version in C a few months down the
  173.         road, and to make it easier on myself, I've been practicing
  174.         programming in structured code, since C has no "GOTO" statement.
  175.         Other minor changes:
  176.  
  177.         1. DATE.REC is now DATECHK.REC
  178.         2. Optimized "Days" function... MUCH faster than the original
  179.         3. Moved most Module-level code into Subs and Functions, to reduce
  180.         data storage needs
  181.  
  182.         ver 2.10
  183.             I've cut out the diagnostic code, because of it taking up to much
  184.         programming time.  (Normally not noticeable to the public, but use
  185.         the /manip switch on the dos command line in versions 2.0 and
  186.         earlier.)  Added the /AUTO switch, which allows you to do
  187.         maintenance unprompted.
  188.  
  189.         ver 2.20
  190.             Further code optimization.  Cut out some more code, for which the
  191.         only reason it was there was to support the "/MANIP" function cut out
  192.         of the last version.
  193.  
  194.         ver 3.00
  195.             USER.BAT and YEARLY.BAT now implemented.  Removed more unnecessary
  196.         code.  Debugged USER and YEARLY routines.
  197.  
  198.         ver 3.50
  199.             Maintenance release.  Added funny looking files.  Current files
  200.         included are:
  201.         DATECHK.EXE     Main Executable
  202.         DATECHK.DAT     Data File
  203.         DATECHK.REC     Date Check Record File (Should not exist initially!)
  204.         README.COM      You are reading this!
  205.         DATECHK.BAS     Date Check Source Code
  206.         FILE_ID.DIZ
  207.  
  208.         ver 3.51
  209.             Maintenance release.
  210.  
  211.         ver 3.60
  212.             Deleted DATECHK.REC.  Current Files Are (AFTER FIRST RUN!!!):
  213.         DATECHK.EXE\
  214.         DATECHK.DAT/ Only files NEEDED to run!!!  MUST be in same
  215.                      directory.
  216.         README.COM
  217.         DATECHK.BAS
  218.         LISTDATA.BAS\
  219.         MAKEDATA.BAS/ Example programs.  Explained in Tech. Section.
  220.         FILE_ID.DIZ
  221.  
  222.         ver 3.61
  223.             MAJOR maintenance release.  It is recommended that you either run
  224.         this version, or ver 3.51.  Last version had bugs in the ReadDate$
  225.         function.
  226.  
  227.         ver 4.00
  228.             Redesigned DATECHK.DAT.  Make sure you copy new file over the old
  229.         one.  Major code rewrite.
  230.  
  231.         ver 5.00
  232.             Major code re-write.  DATECHK.BAS has now been re-written for
  233.         Visual Basic for DOS ver 1.00.  I did this to take advantage of VB's
  234.         advanced functions.  DATECHK.BAS can no longer be run in QB.  LISTDATA
  235.         and MAKEDATA can be run in either Visual Basic for DOS or QB 4.5.
  236.  
  237.         ver 5.20
  238.             Bug fixes, Cosmetic improvements.  Further optimization for use
  239.         under VB for DOS.  More code reductions.
  240.  
  241.         ver 5.30
  242.             Another major code re-write.  Date Check was not executing the
  243.         USER.BAT if any user field byte was equal to 0.  Re-wrote command-line
  244.         parsing method, which allows for more than one command-line argument.
  245.         Added function to disable holiday greets.
  246.  
  247.         ver 5.31
  248.             /AUTO switch not working properly - Fixed.
  249.         BTW, the disable holiday switch is /NOHOLIDAY!
  250.  
  251.         ver 6.00
  252.             MAJOR Re-write.  I re-did the format of the entire Holiday Record
  253.         Section of the DATECHK.DAT file.  I updated the code to handle the new
  254.         changes.  Two new switches: /MAKE and /LIST.  These switches take over
  255.         the job of LISTDATA.BAS and MAKEDATA.BAS.  New Format description in
  256.         the tech section.  Program no longer NEEDS DATECHK.DAT!  It will
  257.         re-construct portions it needs if the file doesn't exist.  If it goes
  258.         corrupt, just erase it, and the program will supply to itself what it
  259.         needs.
  260.  
  261.         New Files Listing:
  262.         DATECHK.EXE
  263.         DATECHK.BAS
  264.         DATECHK.DAT
  265.         README.COM
  266.         FILE_ID.DIZ
  267.  
  268.         ver 7.00
  269.             Just when you thought I couldn't improve it anymore... :)  Minor
  270.         code re-write... Major new option... You may now use the following
  271.         Batch File names for modified Weekly maintenance...
  272.  
  273.         SUNDAY.BAT
  274.         MONDAY.BAT
  275.         TUESDAY.BAT
  276.         WEDNSDAY.BAT
  277.         THURSDAY.BAT
  278.         FRIDAY.BAT
  279.         SATURDAY.BAT
  280.  
  281.         They will execute that batch code on the selected day... (This was
  282.         done by user request...)
  283.  
  284.         ver 7.01
  285.             Minor bug-fix release.  Fixed Documentation (Look at doc header in
  286.         7.00.... Oops! :) )
  287.  
  288.         ver 7.20
  289.             Another Bugfix/Maint. Release... Minor code changes.  Auto execute
  290.         system changed a little.
  291.  
  292.         *Date Check PRO*
  293.         ver 1.00
  294.             Major release.  New options described in the previous section.
  295.         Removed NDOS Descriptions from files.
  296.  
  297.         ver 1.00a
  298.             Released under version 1.01.  Minor bugfix release.
  299.  
  300.         ver 1.01
  301.             Never released.  Actual version number was ver 1.00a
  302.  
  303.         ver 1.20
  304.             Major Bugfix Release from 1.00a
  305.  
  306.         ver 1.25
  307.             Added new switch "/NOWRITE".  Minor bugfix
  308.  
  309.         ver 1.50
  310.             Added three new switches, /PATH, /KILL, /SAVE.  First release
  311.             under Wasted Lights Software.
  312.  
  313.         ver 1.51
  314.             Updated Author Contact info.
  315.  
  316. -------------------------------------------------------------------------------
  317. Technical Section:
  318.         I though I would add this section so that beginning programmers do
  319. not screw up the program Data Files.  The DATECHK.DAT is not meant to
  320. Hex-Edit, but since there are people who would try it anyway...
  321. The DAT file is divided as such: The first record is 5 bytes, and should NOT
  322. be altered. The first 5 bytes are actually bit fields.  This is how it works...
  323.  
  324. |  ||    ||     | |        ||        |
  325. 43215432 17654321 98765432 19876543 21UNUSED
  326. 00000000 00000000 00000000 00000000 00000000
  327.  
  328. Field   Meaning
  329. 1       Current Recorded Month
  330. 2       Current Recorded Day
  331. 3       Current Recorded (Year - 1980)
  332. 4       Recorded User Interval
  333. 5       Recorded Accumulation till next User event
  334.  
  335. To decide whether or not to execute "USER.BAT", the program checks Field 4
  336. against Field 5.  If they are equal, Field 5 is set to "000000000" and the
  337. count begins again.  For all others, Fields 1,2,3 are checked against the
  338. current date.
  339.  
  340. After the first five Bytes, the next bytes are as follows:
  341.  
  342. Header Record:
  343.         Bytes 6-9
  344. Number of entries in directory                          Integer (2 bytes)
  345. Start of Directory (Based on the first byte as 1)       Integer (2 bytes)
  346.  
  347.  
  348. At the byte number of the Directory, you have (Number of Entries) 6-byte
  349. records.  They are composed as follows:
  350.  
  351. Date                             2-byte Date bit field format (see above)
  352.  
  353.         NOTE:  The year field is ignored, and can contain any year from
  354.         1980-2099.
  355. Start of Data Text to display on above Date             Integer (2 bytes)
  356. Length of Data Text to display on above Date            Integer (2 bytes)
  357.  
  358. This format is radically different than the one used in previous versions,
  359. and has 2 advantages.  Searches can be much faster, because the program
  360. only has to "page" through the directory to find the proper string, and
  361. because these are not fixed-byte records, it cuts down on a lot of the "fat"
  362. in previous record files.  BTW, If you are familiar with ID Software's
  363. DOOM, I borrow very heavily on their WAD file format.  It is very
  364. efficient.
  365. -------------------------------------------------------------------------------
  366.  
  367.  
  368.         One last word... Good Luck to all you programmers and
  369.                 hackers out there, wherever you are!!!! :)
  370.  
  371.                                                 -Brian Fields
  372.  
  373.                        Who do I contact in case of problems?
  374.         Contact:
  375.                         Brian Fields
  376.                         398 Kings Hwy
  377.                         Lot 51
  378.                         Marysville, PA 17053-9409
  379.                         (717) 957-2104
  380.         E-Mail:
  381.                         Nightwalker@juno.com
  382.  
  383. I would like to express my thanks to the following people:
  384.  
  385.         R. Bradford (Fubar) Peters - for help with the code, and
  386.                 distribution.
  387.  
  388.         Johnathan (Thrawn )Stevens - for teaching me some of the code used
  389.                 herein.
  390.  
  391.         Gerald Eltringham - for putting up with me for the last THREE
  392.                 years, and for continuing to do so :).
  393.  
  394.         Ricky Scott - for being a major pain in the a$$ on the new code
  395.                 re-write (ver 7.0) :)
  396.  
  397.         Douglas (Howdy) Myers - for the idea for the Semaphore files, and
  398.                 several other new modifications.
  399.  
  400.