home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lan / g0bsx / timer.doc < prev    next >
Text File  |  1989-04-26  |  4KB  |  96 lines

  1. the file: TIMER.EXE is used in the following manner:
  2.  
  3. It must be used in a batch file or be called from another program.
  4. If used in a batch file, it will return an errorlevel of either 0 or 1.
  5.  
  6. Usages:
  7. =======
  8.  
  9. A. As a simple timeout system:
  10. -----------------------------
  11.  
  12. It will return a 1 if a timout has occured and a 0 if it has not.
  13. If program is used with a SINGLE parameter, this must be the time in seconds
  14. to be tested for since the last timeout.
  15.  
  16. e.g. if you say:   timer 100, and more than 100 seconds have elapsed since
  17. the last time a timout was successful, a 1 will be returned, if not, a 0
  18. will be returned.
  19.  
  20. example (in a batch file):
  21.  
  22. timer 120
  23. if errorlevel = 1 backup
  24.  
  25. will cause the program "backup" to be executed if more that 2 minutes have
  26. elapsed since the last the timer program has been used in the timeout mode.
  27.  
  28. B. As a generalised timeout system:
  29. ----------------------------------
  30.  
  31. * Syntax:   timer -opts number
  32.  
  33. * Example:  timer -th 3         will time out if more that 3 hours have passed
  34.                                 since the last successful imeout.
  35.  
  36. Possible options:
  37.    -ty   -  number is in terms of years (!!)
  38.    -tn   -  number is in terma of months
  39.    -td   -  number is in terms of days
  40.    -th   -  number is in terma of hours
  41.    -tm   -  number is in terms of minutes
  42.    -ts   -  number is in terms of seconds
  43.  
  44. C. As an interval tester:
  45. ------------------------
  46.  
  47. * Syntax:   timer -opts n1n2
  48.  
  49. * Examples: timer -ih 0008    will return 1 if the current hour is between 00h
  50.                               and 08h (inclusive) IF timer has not been used in
  51.                               this mode successfully in the current hour. i.e.
  52.                               only ONE true value will be returned per hour.
  53.             timer -iw 56      will return 1 if the current DAY OF WEEK is 5 or
  54.                               6 and timer has not already been used
  55.                               successfully in this mode today.
  56.             timer -om 0040    will return 1 if the current minute is NOT in the
  57.                               range 00 to 40 (inclusive) provided timer has not
  58.                               been used in this mode in the current minute.
  59. * Possible options:
  60.    -ab where a is one of:  i  - Inside a range
  61.                            o  - Outside a range
  62.        where b is one of:  y  - year. number must be 4 digits long, eg 8990
  63.                            n  - month. number must be 4 digits long, eg 0205
  64.                            d  - day. number must be 4 digits long, e.g. 2225
  65.                            w  - day of week. number must be 2 digits. e.g. 01
  66.                            h  - hour. number must be 4 digits long. e.g. 0023
  67.                            m  - minutes. number must be 4 digits long.
  68.                            s  - seconds. number must be 4 digits long.
  69. * further examples:
  70.  
  71.  timer -iw 00   will cause a single possitive result on sunday
  72.  timer -oh 1723 will cause a positive result once each hour (if run frequently)
  73.                 OUTSIDE the hours 17h to 23h.
  74.  
  75. NOTE: timer values are held INDEPENDENTLY for each TIME mode. Therefore, a
  76.       MINUTE based call with timer does not interfere with an HOUR based call,
  77.       and so on. TIMER can therefore be run several times in a batch file in
  78.       different modes without interaction:
  79.       e.g.   timer -ih 0006
  80.              if errorlevel 1 morningprog
  81.              timer -iw 00
  82.              if errorlevel 1 sundayprog
  83.              timer -id 2830
  84.              if errorlevel 1 endofmonthprog  (run each day for 3 days in this
  85.                                               example)
  86.  
  87. General Note:
  88. -------------
  89.  
  90. TIMER maintains a data file by the name of TIMER.DAT in the current directory.
  91. If desired, multiple different and independent systems can be run by simply
  92. defining different directories and changing to these in turn to access
  93. different TIMER.DAT files....
  94.  
  95. hope this is useful, Peter G0BSX @ GB7PLY
  96.