home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / DELAY.LZH / DELAY.DOC < prev    next >
Text File  |  1991-07-14  |  3KB  |  77 lines

  1.                             DELAY.EXE
  2.                 ---------------------------------
  3. Delay is simple to use: just type the name followed by the number of
  4. seconds you want to pause (delay), followed optionally by H, M, S, D, E,
  5. O, Y, W, I, P or K.  Delay is bound and will run under either MS-DOS or
  6. OS/2.
  7.  
  8. Type Delay without parameters for a brief help screen.  If you screw up
  9. in an obvious way, Delay will try to give you some help.  The help
  10. screen looks like:
  11.  
  12.  
  13. No Delay requested...(DELAY #secs <HMSDEOYWIPK> [args])
  14.  
  15. Letter                   ERRORLEVEL
  16. ======                   =========================
  17. H                        Hours
  18. M                        Minutes
  19. S                        Seconds
  20. D                        Day-of-month
  21. E                        Day-of-year (remember 255 errorlevel limit)
  22. O                        Month
  23. Y                        2-digit Year
  24. W                        Day-of-week
  25. I <hh:mm:ss> <hh:mm:ss>  0 if in hours, 1 if out
  26. P <hh:mm>                0 when time occurs
  27. K <keys> <secs>          key position or 0 on timeout
  28.  
  29.  If ESCape aborts any delays, 255 is returned.
  30.  
  31.  
  32. Delay will return an errorlevel equal to the Hours, Minutes or Seconds
  33. on the system clock, or the Day-of-month, mOnth, Year, day-of-Week, or
  34. day-of-yEar on the system calendar, or whether or not you are Inside an
  35. "event".  The default is Seconds.  It will also wait for a given time or
  36. get keypresses in a definable time period.  This should make DELAY ideal
  37. for timing and scheduling from a batch file.
  38.  
  39. Examples:
  40.  
  41. DELAY 1 M
  42.     (Pause 1 second, exit with errorlevel equal to minutes)
  43. DELAY 0 H
  44.     (No pause, exit with errorlevel equal to hours)
  45. DELAY 5
  46.     (5 second pause, seconds errorlevel by default)
  47. DELAY 0 O
  48.     (No pause, exit with errorlevel equal to month [Jan=1])
  49. DELAY 0 W
  50.     (No pause, exit with errorlevel equal to day-of-week [Sun=1])
  51. DELAY 0 Y
  52.     (No pause, exit with errorlevel equal to last two digits of year)
  53. DELAY 0 I 12:00:00 14:00:00
  54.     (Return 0 if in hours, 1 if out)
  55. DELAY 0 P 13:00
  56.     (Return 0 if 13:00 reached, 255 if ESCape pressed)
  57. DELAY 0 K ABCD 30
  58.     (Return 1 if A pressed, 2 if B pressed, 3 if C, 4 if D, 255 if
  59.      ESCape, 0 if 30 seconds elapses with no valid key pressed)
  60.  
  61. Note that besides the obvious uses for DELAY (checking time, date, and
  62. so on), you can use it to "randomize" batch files.  Consider this
  63. pseudo-fragment:
  64.  
  65. DELAY 0 S
  66. IF ERRORLEVEL 30 GOTO DOTHAT
  67. :DOTHIS
  68. REM DO SOMETHING
  69. GOTO DONEDO
  70. :DOTHAT
  71. REM DO SOMETHING ELSE
  72. :DONEDO
  73.  
  74.  
  75. M. Kimes    1:380/16.0@fidonet
  76.             (318)222-3455 data
  77.