
                           Wasted Lights Software
                                  Presents

                          Date Check Pro ver 1.61
_______________________________________________________________________________


                          What is Date Check Pro?

        Date Check was originally a program to only perform daily,
        weekly, and monthly maintenance.  It finally evolved WAY beyond
        it's original purpose to include many professional operations.
        After Date Check version 7.20, it finally warranted a fairly new
        algorithm, and a new name.  Date Check Pro has finally been born.


                          How do I use Date Check?

        Date Check can be used in several modes of operation.  Normal users
        only need to concern themselves with the first two.

        1. Single Home Computer User/Normal Maintenance.
            This mode is the default.  It is used to start any of the other
            modes, or used by itself.  If you put the program as the last (or
            near last) line in your autoexec.bat, it will look at the date, and
            depending on certain conditions, will perform special batch files
            for you.

            These batch files must be called:

            DAILY.BAT               For once-a-day maintenance
            WEEKLY.BAT              For once-a-week maintenance
            MONTHLY.BAT             For once-a-month maintenance
            YEARLY.BAT              For once-a-year maintenance
            MONDAY.BAT              To execute on Monday
            TUESDAY.BAT             To execute on Tuesday
            WEDNSDAY.BAT            To execute on Wednesday
            THURSDAY.BAT            To execute on Thursday
            FRIDAY.BAT              To execute on Friday
            SATURDAY.BAT            To execute on Saturday
            SUNDAY.BAT              To execute on Sunday
            MM-DD.BAT               To execute on MM/DD (MM being a month,
                                    DD being a day.  Ex. 01-01.BAT for Jan
                                    1st, 02-14.BAT for Valentines day, and
                                    so on...
            USER.BAT                Will execute on a User-Defined
                                    Interval... This is either configured
                                    when you first run Date Check, or by
                                    using the /Config option (Explained
                                    later...)

            These will execute only once on the specified day, or interval.
            Very convenient for Virus Checkers, Hard Disk Defraggers, etc...

            *NOTE* IF /PATH OPTION IS NOT SPECIFIED ON THE COMMAND LINE, OR
            IS NOT SAVED IN THE INI FILE, PROGRAM DATA FILE WILL BE DEPOSITED
            IN THE DIRECTORY YOU START THE PROGRAM FROM.  BATCH FILES AND
            EXECUTABLE MUST BE IN THE PATH.  SEMAPHORE FILES WILL ALSO BE IN
            THE DIRECTORY THE PROGRAM WAS STARTED FROM.

            The options available in this mode are:

                /SEM            Starts the program in mode two.
                /CHECK          Assumes all appropriate maintenance needs done.
                                Good for verifying batch files are working
                                properly.   Does not work with the time
                                function, unless after (or before) specified
                                time.
                /AUTO           Performs all maintenance unattended.
                /CONFIG         Re-configures user defined interval
                /NOHOLIDAY      Disables holiday greetings
                /MAKE           Starts the program in mode three
                /LIST           Starts the program in mode four
                /NOWRITE        Disables writing to the DATECHK.DAT file.
                                Forces the program to run again the next time
                                it's executed.  Debugging/Special Purpose
                                only!
                /UPDATE         Writes to the DATECHK.DAT file without
                                executing any of the batches.
                                Debugging/Special Purpose Only!
                /PATH <Dir>     Forces Date Check to look in <dir> for all
                                file transactions except for DATECHK.INI
                                (Which MUST be in the same Directory you
                                execute Date Check from)
                /SAVE           Saves Options in DATECHK.INI
                /KILL           Kills Saved Options
                /TIME <time>    Allows another dimension to Date Check
                                logic.  Only executes batchfiles, creates
                                semaphores, etc., if Date Check is executed
                                after a certain time.  Use any 24hr or 12hr
                                time, ie, HH:SS, or HH:SSPM or HH:SSAM,
                                etc...
                /BEFORE         Use with the /TIME option to execute BEFORE
                                a certain time only, instead of after.

        2. Semaphore Mode/BBS Mode
            This mode was designed for BBS Sysops to use with front-end
            mailer events and BBS events.  Instead of executing the batch
            files in the previous section, It creates semaphore files with the
            ".DCS" extension, and named by the same name as the batch files
            were.  Switches available in this mode are:

                /CONFIG         Re-configures user defined interval.
                /CHECK          Assumes all appropriate maintenance needs done;
                                Good for verifying semaphore writes.
                /NOWRITE        Disables writing to the DATECHK.DAT file.
                                Forces the program to run again the next time
                                it's executed.  Debugging/Special Purpose only!
                /UPDATE         Writes to the DATECHK.DAT file without
                                executing any of the batches.
                                Debugging/Special Purpose Only!
                /PATH <Dir>     Forces Date Check to look in <dir> for all file
                                transactions except for DATECHK.INI (Which MUST
                                be in the same Directory as Date Check)
                /SAVE           Saves Options in DATECHK.INI
                /KILL           Kills Saved Options
                /TIME <Time>    Allows another dimension to Date Check
                                logic.  Only executes batchfiles, creates
                                semaphores, etc., if Date Check is executed
                                after a certain time.  Use any 24hr or 12hr
                                time, ie, HH:SS, or HH:SSPM or HH:SSAM,
                                etc...
                /BEFORE         Use with the /TIME option to execute BEFORE
                                a certain time only, instead of after.

        3. Make Holiday list mode
            This makes the list of things to say in normal mode on
            specified days.  For example, it defines December 25 to say "Merry
            Christmas".  To see the current list, use the /LIST option.

        4. List Holidays mode
            Creates a text file with the current list of holidays.
        
                        Date Check Zips
        Like a lot of programmers have been doing lately, I have
        taken to giving naming rules to my ZIP files.

        DTCKP (Version).zip
        In other words, you should have received this zip as
        DTCKP161.ZIP


                                 Revision History

        *Original Date Check*
        ver .5 eta
            Original version of program... One word... SUCKED!!!  It could only
        handle monthly and daily maintenance, and had a few glitches in the
        algorithm.

        ver .99 eta
            Added Weekly Maintenance.  Also added a few diagnostic options, to
        check for bugs more efficiently.  Problem with weekly maintenance,
        I had to use someone else's code until I could correct it.  Didn't
        want to, because of possible copyright infringements.

        ver 1.00
            Finally perfected weekly code.  Was informed by someone that the
        year 2000 was NOT a leap year, although it is divisible by 4.  Created
        code to count up days, and then get the modulus for the weekday.
        Optimized the code so some delays were taken care of.  This is about
        as best as the program can get. Decided to release it to public.

        ver 1.01
            Ok, so it wasn't the best... I fixed a bug for when Datechk would
        be first run, it would give me an overflow error.  I also
        compressed the date storage. (Ok, so it was small to begin with...
        I did it just to see if I could do it...) I reduced the file from 12
        bytes to 3 bytes.  No big deal, but I intend to use the technology
        in other programs I have.  The program will automatically erase and
        update the old DATE.REC.

        ver 1.02        
            I optimized the routines, reduced code from constants to loops, and
        reduced the DATE.REC to 2 bytes... (Yes I'm obsessed with trying to 
        see what I can do.)

        ver 1.03
            Further optimization, and Found out that the year 2000 is, in fact,
        a leap year.  Would not have run into problems till year 2000, but
        I hate a messy program.

        ver 1.04
            Added capability to choose whether or not to execute the batch
        files

        ver 2.00
            I've optimized ALL of the routines to the best of my ability for
        speed.  I've also put most of the key options in CONST statements, for
        ease in customizing.  I've decided that I would finally just release
        this program into the public domain, considering that

        1. No one sent me money (Damn!!!)
        2. I have been mainly programming this for myself

        Because of this, I've also decided that I'd also release the
        QuickBasic source code, and you can customize the program for you
        own needs.  I will release a version in C a few months down the
        road, and to make it easier on myself, I've been practicing
        programming in structured code, since C has no "GOTO" statement.
        Other minor changes:

        1. DATE.REC is now DATECHK.REC
        2. Optimized "Days" function... MUCH faster than the original
        3. Moved most Module-level code into Subs and Functions, to reduce
        data storage needs

        ver 2.10
            I've cut out the diagnostic code, because of it taking up to much
        programming time.  (Normally not noticeable to the public, but use
        the /manip switch on the dos command line in versions 2.0 and
        earlier.)  Added the /AUTO switch, which allows you to do
        maintenance unprompted.

        ver 2.20
            Further code optimization.  Cut out some more code, for which the
        only reason it was there was to support the "/MANIP" function cut out
        of the last version.

        ver 3.00
            USER.BAT and YEARLY.BAT now implemented.  Removed more unnecessary
        code.  Debugged USER and YEARLY routines.

        ver 3.50
            Maintenance release.  Added funny looking files.  Current files
        included are:
        DATECHK.EXE     Main Executable
        DATECHK.DAT     Data File
        DATECHK.REC     Date Check Record File (Should not exist initially!)
        README.COM      You are reading this!
        DATECHK.BAS     Date Check Source Code
        FILE_ID.DIZ

        ver 3.51
            Maintenance release.

        ver 3.60
            Deleted DATECHK.REC.  Current Files Are (AFTER FIRST RUN!!!):
        DATECHK.EXE\
        DATECHK.DAT/ Only files NEEDED to run!!!  MUST be in same
                     directory.
        README.COM
        DATECHK.BAS
        LISTDATA.BAS\
        MAKEDATA.BAS/ Example programs.  Explained in Tech. Section.
        FILE_ID.DIZ

        ver 3.61
            MAJOR maintenance release.  It is recommended that you either run
        this version, or ver 3.51.  Last version had bugs in the ReadDate$
        function.

        ver 4.00
            Redesigned DATECHK.DAT.  Make sure you copy new file over the old
        one.  Major code rewrite.

        ver 5.00
            Major code re-write.  DATECHK.BAS has now been re-written for
        Visual Basic for DOS ver 1.00.  I did this to take advantage of VB's
        advanced functions.  DATECHK.BAS can no longer be run in QB.  LISTDATA
        and MAKEDATA can be run in either Visual Basic for DOS or QB 4.5.

        ver 5.20
            Bug fixes, Cosmetic improvements.  Further optimization for use
        under VB for DOS.  More code reductions.

        ver 5.30
            Another major code re-write.  Date Check was not executing the
        USER.BAT if any user field byte was equal to 0.  Re-wrote command-line
        parsing method, which allows for more than one command-line argument.
        Added function to disable holiday greets.

        ver 5.31
            /AUTO switch not working properly - Fixed.
        BTW, the disable holiday switch is /NOHOLIDAY!

        ver 6.00
            MAJOR Re-write.  I re-did the format of the entire Holiday Record
        Section of the DATECHK.DAT file.  I updated the code to handle the new
        changes.  Two new switches: /MAKE and /LIST.  These switches take over
        the job of LISTDATA.BAS and MAKEDATA.BAS.  New Format description in
        the tech section.  Program no longer NEEDS DATECHK.DAT!  It will
        re-construct portions it needs if the file doesn't exist.  If it goes
        corrupt, just erase it, and the program will supply to itself what it
        needs.

        New Files Listing:
        DATECHK.EXE
        DATECHK.BAS
        DATECHK.DAT
        README.COM
        FILE_ID.DIZ

        ver 7.00
            Just when you thought I couldn't improve it anymore... :)  Minor
        code re-write... Major new option... You may now use the following
        Batch File names for modified Weekly maintenance...

        SUNDAY.BAT
        MONDAY.BAT
        TUESDAY.BAT
        WEDNSDAY.BAT
        THURSDAY.BAT
        FRIDAY.BAT
        SATURDAY.BAT

        They will execute that batch code on the selected day... (This was
        done by user request...)

        ver 7.01
            Minor bug-fix release.  Fixed Documentation (Look at doc header in
        7.00.... Oops! :) )

        ver 7.20
            Another Bugfix/Maint. Release... Minor code changes.  Auto execute
        system changed a little.

        *Date Check PRO*
        ver 1.00
            Major release.  New options described in the previous section.
        Removed NDOS Descriptions from files.

        ver 1.00a
            Released under version 1.01.  Minor bugfix release.

        ver 1.01
            Never released.  Actual version number was ver 1.00a

        ver 1.20
            Major Bugfix Release from 1.00a

        ver 1.25
            Added new switch "/NOWRITE".  Minor bugfix

        ver 1.50
            Added three new switches, /PATH, /KILL, /SAVE.  First release
            under Wasted Lights Software.

        ver 1.51
            Updated Author Contact info.

        ver 1.60
            At user request, added the /TIME, /BEFORE, and /UPDATE
            switches.

        ver 1.61
            Minor bugfix release.

-------------------------------------------------------------------------------
Technical Section:
        I though I would add this section so that beginning programmers do
not screw up the program Data Files.  The DATECHK.DAT is not meant to
Hex-Edit, but since there are people who would try it anyway...
The DAT file is divided as such: The first record is 5 bytes, and should NOT
be altered. The first 5 bytes are actually bit fields.  This is how it works...

|  ||    ||     | |        ||        |
43215432 17654321 98765432 19876543 21UNUSED
00000000 00000000 00000000 00000000 00000000

Field   Meaning
1       Current Recorded Month
2       Current Recorded Day
3       Current Recorded (Year - 1980)
4       Recorded User Interval
5       Recorded Accumulation till next User event

To decide whether or not to execute "USER.BAT", the program checks Field 4
against Field 5.  If they are equal, Field 5 is set to "000000000" and the
count begins again.  For all others, Fields 1,2,3 are checked against the
current date.

After the first five Bytes, the next bytes are as follows:

Header Record:
        Bytes 6-9
Number of entries in directory                          Integer (2 bytes)
Start of Directory (Based on the first byte as 1)       Integer (2 bytes)


At the byte number of the Directory, you have (Number of Entries) 6-byte
records.  They are composed as follows:

Date                             2-byte Date bit field format (see above)

        NOTE:  The year field is ignored, and can contain any year from
        1980-2099.
Start of Data Text to display on above Date             Integer (2 bytes)
Length of Data Text to display on above Date            Integer (2 bytes)

This format is radically different than the one used in previous versions,
and has 2 advantages.  Searches can be much faster, because the program
only has to "page" through the directory to find the proper string, and
because these are not fixed-byte records, it cuts down on a lot of the "fat"
in previous record files.  BTW, If you are familiar with ID Software's
DOOM, I borrow very heavily on their WAD file format.  It is very
efficient.
-------------------------------------------------------------------------------


        One last word... Good Luck to all you programmers and
                hackers out there, wherever you are!!!! :)

                                                -Brian Fields

                       Who do I contact in case of problems?
        Contact:
                        Brian Fields
                        398 Kings Hwy
                        Lot 51
                        Marysville, PA 17053-9409
                        (717) 957-2104
        E-Mail:
                        Nightwalker@juno.com

I would like to express my thanks to the following people:

        R. Bradford (Fubar) Peters - for help with the code, and
                distribution.

        Johnathan (Thrawn )Stevens - for teaching me some of the code used
                herein.

        Gerald Eltringham - for putting up with me for the last THREE
                years, and for continuing to do so :).

        Ricky Scott - for being a major pain in the a$$ on the new code
                re-write (ver 7.0) :)

        Douglas (Howdy) Myers - for the idea for the Semaphore files, and
                several other new modifications.

