home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / DATES1A.LZH / DATES.DOC < prev   
Text File  |  1990-06-03  |  16KB  |  422 lines

  1.  
  2.           DATES - Release 1a                                          Page  1
  3.  
  4.  
  5.  
  6.                                       DATES
  7.                Edit Dates/Times into a Command Line & Execute It.
  8.                            Release 1a - 3rd June 1990
  9.                        Copyright (C) 1990 by Graham Stair
  10.  
  11.  
  12.  
  13.           Introduction
  14.  
  15.           DATES is an enhanced replacement to Ben Bakers DAYNBR. It came about
  16.           because I needed to put more than just the Julian day in my  command
  17.           line, and I needed  it in the  OS/2 environment as  well as the  DOS
  18.           environment.
  19.  
  20.           DATES enhancements over DAYNBR are...
  21.  
  22.                It passes the return code back from the command line.
  23.                It has extra date and time edit strings.
  24.                Distributed with versions to run under OS/2 or DOS.
  25.                Uses the COMSPEC environment variable.
  26.                Logs elapsed time, return code and command line.
  27.  
  28.  
  29.  
  30.           License Information
  31.  
  32.           DATES  is  a  FREELY  AVAILABLE  package,  along  similar  lines  as
  33.           Binkleyterm and it's source.  If you would like  the source code  to
  34.           DATES, please  contact me.  The source  is free  and ONLY  available
  35.           DIRECT from me at your cost.
  36.  
  37.           DATES and it's source code are  NOT public domain, you can NOT  make
  38.           changed copies available for anybody else without my permission. Any
  39.           source changes should be re-directed back to me for possible use  in
  40.           future versions of DATES.
  41.  
  42.           Please contact me data at ...
  43.  
  44.           3:711/409.0    +61-2-498-9184
  45.  
  46.           or snail mail at ...
  47.  
  48.           Graham Stair
  49.           P.O.Box 99
  50.           Pymble NSW 2073
  51.           Australia
  52.  
  53.           DATES - Release 1a                                          Page  2
  54.  
  55.  
  56.  
  57.           Table of Contents
  58.  
  59.           INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
  60.  
  61.           LICENSE INFORMATION  . . . . . . . . . . . . . . . . . . . . . . . 1
  62.  
  63.           TABLE OF CONTENTS  . . . . . . . . . . . . . . . . . . . . . . . . 2
  64.  
  65.           PACKAGING  . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
  66.  
  67.           USAGE: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
  68.              Explanation of {options}  . . . . . . . . . . . . . . . . . . . 3
  69.                 /+nnn     Add <nnn> days to the reference date.  . . . . . . 3
  70.                 /-nnn     Subtract <nnn> days from the reference date. . . . 3
  71.                 /Dn       Select a specific day <n>. . . . . . . . . . . . . 3
  72.                 /C        Force use of COMSPEC environment variable. . . . . 4
  73.                 /?        Help screen. . . . . . . . . . . . . . . . . . . . 4
  74.              Edit strings in COMMAND {parameters}  . . . . . . . . . . . . . 4
  75.                 Date replacements  . . . . . . . . . . . . . . . . . . . . . 4
  76.                    `0### or @###  Julian day of the year.  . . . . . . . . . 4
  77.                    `1####         Year, including century. . . . . . . . . . 4
  78.                    `2##           Year, excluding century.   . . . . . . . . 4
  79.                    `3##           Month. . . . . . . . . . . . . . . . . . . 4
  80.                    `4###          First 3 characters of the month name.  . . 4
  81.                    `5##           Day of month.  . . . . . . . . . . . . . . 4
  82.                    `6###          First 3 characters of the day name.  . . . 4
  83.                 Time replacements  . . . . . . . . . . . . . . . . . . . . . 5
  84.                    `A##           System hour. . . . . . . . . . . . . . . . 5
  85.                    `B##           System minute. . . . . . . . . . . . . . . 5
  86.                    `C##           System seconds.  . . . . . . . . . . . . . 5
  87.                    `D#####        System seconds since midnight. . . . . . . 5
  88.                    `E########     Seconds since midnight of 1st of Jan . . . 5
  89.  
  90.           ENVIRONMENT VARIABLES  . . . . . . . . . . . . . . . . . . . . . . 5
  91.              COMSPEC        This points to your command processor,   . . . . 5
  92.              DATES.LOG      {drive}{path}filename{.ext}  . . . . . . . . . . 5
  93.              OPUS.LOG       {drive}{path}filename{.ext}  . . . . . . . . . . 5
  94.              BBS.LOG        {drive}{path}filename{.ext}  . . . . . . . . . . 5
  95.  
  96.           EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
  97.  
  98.           COMPATIBILITY WITH DAYNBR. . . . . . . . . . . . . . . . . . . . . 7
  99.              Incompatibilities . . . . . . . . . . . . . . . . . . . . . . . 7
  100.              Enhanced Incompatibilities  . . . . . . . . . . . . . . . . . . 7
  101.  
  102.           OTHER PROGRAM OFFERINGS  . . . . . . . . . . . . . . . . . . . . . 8
  103.  
  104.           HISTORY  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
  105.  
  106.           DATES - Release 1a                                          Page  3
  107.  
  108.  
  109.  
  110.           Packaging
  111.  
  112.           The following files should be in your DATESxx archive.
  113.  
  114.           DATES-R.EXE    DOS Real mode version of DATES.
  115.           DATES-P.EXE    OS/2 Protected mode version of DATES.
  116.           DATES.DOC      This documentation.
  117.  
  118.  
  119.  
  120.           Usage:
  121.  
  122.                DATES {options} COMMAND {parameters}
  123.  
  124.  
  125.           Explanation of {options}
  126.  
  127.                /+nnn     Add <nnn> days to the reference date.
  128.  
  129.                /-nnn     Subtract <nnn> days from the reference date.
  130.  
  131.                <nnn> may any decimal number  from 0 to 32 thousand  something.
  132.                Although in practice the dates are limited to the range 1st Jan
  133.                1980 to 18th Jan 2038.
  134.  
  135.                /Dn       Select a specific day <n>.
  136.  
  137.                          <n> is a single digit which selects a specific day on
  138.                          or prior to  the reference  date. The  digits are  as
  139.                          follows...
  140.                               0 .. Sunday
  141.                               1 .. Monday
  142.                               2 .. Tuesday
  143.                               3 .. Wednesday
  144.                               4 .. Thursday
  145.                               5 .. Friday
  146.                               6 .. Saturday
  147.  
  148.                The reference  date starts  out as  the system  date.  Multiple
  149.                {options} can  appear and  are processed  left to  right,  each
  150.                modifying the previous reference date in it's own way.
  151.  
  152.           DATES - Release 1a                                          Page  4
  153.  
  154.  
  155.  
  156.                /C        Force use of COMSPEC environment variable.
  157.  
  158.                          This option  forces DATES  to invoke  the COMMAND  by
  159.                          directly  calling  the   operating  systems   command
  160.                          processor (pointed  to  by  the  COMSPEC  environment
  161.                          variable).
  162.  
  163.                          If this  option  isn't  used, DATES  first  tries  to
  164.                          execute COMMAND by by-passing the command  processor.
  165.                          If the COMMAND isn't executed correctly, it then uses
  166.                          the command processor.
  167.  
  168.                          You would use  this option in  the cases where  DATES
  169.                          does not execute the command correctly without  going
  170.                          through the  command  processor.  Note,  this  option
  171.                          takes additional memory as  the command processor  is
  172.                          being loaded no matter what.
  173.  
  174.                /?        Help screen.
  175.  
  176.  
  177.  
  178.           Edit strings in COMMAND {parameters}
  179.  
  180.           COMMAND {parameters} is  any string with  DATES edit strings,  which
  181.           after replacement is converted to a valid operating system command.
  182.  
  183.           The COMMAND and {parameters} can contain the following edit strings.
  184.           These  edit  strings  will  be  replaced  with  the  date  and  time
  185.           information of the reference  date as indicated  here, then the  new
  186.           COMMAND {parameters}  will be  passed to  the operating  system  for
  187.           execution.
  188.  
  189.           The edit code, ` (ascii 096), and it's one character identifier  (of
  190.           which the case  is irrelevant),  are not  moved to  the new  COMMAND
  191.           line. Each of the hashes (#)  are converted and take up exactly  one
  192.           spot in the final COMMAND line. They are zero filled on the left  if
  193.           need be. The at symbol (@), can be  used in place of the `0 for  the
  194.           Julian date only.
  195.  
  196.  
  197.           Date replacements
  198.  
  199.                `0### or @###  Julian day of the year.
  200.                `1####         Year, including century.
  201.                `2##           Year, excluding century.
  202.                `3##           Month.
  203.                `4###          First 3 characters of the month name.
  204.                `5##           Day of month.
  205.                `6###          First 3 characters of the day name.
  206.  
  207.           DATES - Release 1a                                          Page  5
  208.  
  209.  
  210.  
  211.           Time replacements
  212.  
  213.                `A##           System hour.
  214.                `B##           System minute.
  215.                `C##           System seconds.
  216.                `D#####        System seconds since midnight.
  217.                `E########     Seconds since midnight of 1st of Jan
  218.                               of the reference year.
  219.  
  220.           If you want  to use  a `  (ascii 096, 0x60)  or @  without it  being
  221.           interpreted as an edit string, put two of them together (I.E. ``  or
  222.           @@). Any non #'s in any of  the edit strings, in any position,  will
  223.           NOT be replaced.
  224.  
  225.           The /+nnn, /-nnn and /Dn options will not affect the `A, `B, `C, and
  226.           `D edit strings,  as these are  relative to midnight  of the  system
  227.           date and thus don't change when a day changes.
  228.  
  229.           First DATES tries to execute  your modified COMMAND by using  normal
  230.           operating system procedures to find the command. I.E. looking in the
  231.           current directory  and then  checking  down the  paths in  the  PATH
  232.           environment variable. If the  COMMAND is not  found, DATES tries  to
  233.           execute it once again by prepending the COMSPEC environment variable
  234.           to the command and running that.  If the command is still not  found
  235.           or the COMSPEC variable isn't declared then an error is produced.
  236.  
  237.  
  238.  
  239.           Environment Variables
  240.  
  241.           DATES uses up to two environment variables. They are..
  242.  
  243.           COMSPEC        This points to your command processor,
  244.                          and is required to be set.
  245.  
  246.           Only the FIRST of the following environment variables will be  used.
  247.           Each points to a log filename. If one of these is defined, one  line
  248.           containing the elapsed time (et), return code (rc) and command  line
  249.           (cl) executed is logged to the file. If none are define, no  logging
  250.           is done.
  251.  
  252.           DATES.LOG      {drive}{path}filename{.ext}
  253.           OPUS.LOG       {drive}{path}filename{.ext}
  254.           BBS.LOG        {drive}{path}filename{.ext}
  255.  
  256.           The {drive},  {path}  and {.ext}  are  optional. If  you  leave  out
  257.           {drive} and  {path},  remember, your  COMMAND  line may  change  the
  258.           current drive and/or directory, thus leaving filename's created  all
  259.           over your disk(s).
  260.  
  261.           DATES - Release 1a                                          Page  6
  262.  
  263.  
  264.  
  265.           Examples
  266.  
  267.                DATES ECHO `0###     ..or..     DATES ECHO @###
  268.  
  269.           This will echo the current Julian day of the year to the screen.  If
  270.           you want the look at the  most recent Sundays Julian day number  you
  271.           would add a /D0 between DATES and ECHO.
  272.  
  273.  
  274.                DATES /+1000 /D4 ECHO `6### `1####/`3##/`5## `a##:`b##:`c##
  275.  
  276.           The above command will first get  the system date, add 1000 days  to
  277.           it (/+1000), then find the most recent Thursday (/D4). Then it  will
  278.           produce something like this 'Thu 1993/02/11 17:50:23'
  279.  
  280.  
  281.                DATES /+10 /D5 /-10 ECHO `2##/`0###
  282.  
  283.           This will add  10 days (/+10)  onto the system  date, find the  most
  284.           recent Friday  then take  10  days off  (/-10)  this date.  This  is
  285.           different to /+10 /-10 /D5, try it!
  286.  
  287.  
  288.                DATES DAY`6###
  289.  
  290.           This command  will  execute  files called  DAYSUN,  DAYMON,  DAYTUE,
  291.           DAYWED, DAYTHU, DAYFRI, DAYSAT on their respective days.
  292.  
  293.  
  294.                DATES /-7 DATES DATES /+7 ECHO `0A## ``0#B# ````0##C
  295.  
  296.           will show something like this
  297.                A37 1B4 15C
  298.  
  299.  
  300.                DATES RENAME bbs.log `E########.log
  301.  
  302.           will rename bbs.log to the number of seconds since the new year.
  303.  
  304.           DATES - Release 1a                                          Page  7
  305.  
  306.  
  307.  
  308.           Compatibility with DAYNBR.
  309.  
  310.           First, a big thanks to Ben  Baker for producing DAYNBR V1.0 back  in
  311.           1985.  I  just  out  grew  it...  with  DATES  the  results.   These
  312.           incompatibilities are due to MS C 5.1 limitations. If you  currently
  313.           don't use any of the problems and features below, you can copy DATES
  314.           to DAYNBR and start using it straight away.
  315.  
  316.  
  317.           Incompatibilities
  318.  
  319.           DAYNBR can handle dates +/-  32 thousand something from the  current
  320.           date. DATES works in the range 1 Jan 1980 - 18 Jan 2038.
  321.  
  322.           DAYNBR can have  straight double  quotes (")  in it's  <parameters>.
  323.           DATES needs a  \ (backslash) if  you want the  literal double  quote
  324.           (").  I.E.
  325.  
  326.                DATES /D5 FIND \";A\" NODELIST.`0###
  327.  
  328.           will find all occurrences of ;A in the current nodelist.
  329.  
  330.  
  331.           Enhanced Incompatibilities
  332.  
  333.           The following "incompatibilities"  are due to  my enhancements  over
  334.           DAYNBR.
  335.  
  336.           DATES uses the ` (ascii 096) character as an edit string enabler. If
  337.           you want to use this character normally, double it up.
  338.  
  339.           DATES returns the return code (for testing with the ERRORLEVEL batch
  340.           facility) of the COMMAND it executed.
  341.  
  342.           Your COMSPEC environment  variable is  REQUIRED to  be defined  (and
  343.           pointing  to  your  command  processor)  under  DATES.  DAYNBR   has
  344.           COMMAND.COM hard coded into it's code, thus requiring COMMAND.COM to
  345.           be in the path.
  346.  
  347.           Some programs that run under DAYNBR, won't run under DATES. This  is
  348.           usually because the  programs don't  like being  called directly  by
  349.           DATES. Try using the /C option  to go through the command  processor
  350.           in these cases.  I have found  only one program  that requires  this
  351.           option so far, that is, IBM's PS2TAPE V1.11 program for DOS.
  352.  
  353.           DATES - Release 1a                                          Page  8
  354.  
  355.  
  356.  
  357.           Other Program Offerings
  358.  
  359.           The following  program offerings  are  other software  developed  by
  360.           myself. If you would like any of them please contact me.
  361.  
  362.           GOOSE     On-line password checker/changer/enforcer  for OPUS  1.0x,
  363.                     OPUS 1.1x and MAXIMUS 1.0x. (DOS)
  364.           LOGS      Split and/or  Merge OPUS/BINK  style log  files. (DOS  and
  365.                     OS/2)
  366.           RECURR    Schedule recurring events. (DOS)
  367.           LOGMSG    Log messages (incl disk space) to an OPUS/BINK style  log.
  368.                     (DOS and OS/2)
  369.           MR/PM     Message  Reader  for  OS/2   PM  for  OPUS  1.1x.   (Under
  370.                     development)
  371.  
  372.  
  373.           History
  374.  
  375.           23 May 90 - Release 1a beta
  376.                Released for limited testing.
  377.  
  378.           03 Jun 90 - Release 1a
  379.                Added /C Option.
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.