home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
DELAY.LZH
/
DELAY.DOC
< prev
next >
Wrap
Text File
|
1991-07-14
|
3KB
|
77 lines
DELAY.EXE
---------------------------------
Delay is simple to use: just type the name followed by the number of
seconds you want to pause (delay), followed optionally by H, M, S, D, E,
O, Y, W, I, P or K. Delay is bound and will run under either MS-DOS or
OS/2.
Type Delay without parameters for a brief help screen. If you screw up
in an obvious way, Delay will try to give you some help. The help
screen looks like:
No Delay requested...(DELAY #secs <HMSDEOYWIPK> [args])
Letter ERRORLEVEL
====== =========================
H Hours
M Minutes
S Seconds
D Day-of-month
E Day-of-year (remember 255 errorlevel limit)
O Month
Y 2-digit Year
W Day-of-week
I <hh:mm:ss> <hh:mm:ss> 0 if in hours, 1 if out
P <hh:mm> 0 when time occurs
K <keys> <secs> key position or 0 on timeout
If ESCape aborts any delays, 255 is returned.
Delay will return an errorlevel equal to the Hours, Minutes or Seconds
on the system clock, or the Day-of-month, mOnth, Year, day-of-Week, or
day-of-yEar on the system calendar, or whether or not you are Inside an
"event". The default is Seconds. It will also wait for a given time or
get keypresses in a definable time period. This should make DELAY ideal
for timing and scheduling from a batch file.
Examples:
DELAY 1 M
(Pause 1 second, exit with errorlevel equal to minutes)
DELAY 0 H
(No pause, exit with errorlevel equal to hours)
DELAY 5
(5 second pause, seconds errorlevel by default)
DELAY 0 O
(No pause, exit with errorlevel equal to month [Jan=1])
DELAY 0 W
(No pause, exit with errorlevel equal to day-of-week [Sun=1])
DELAY 0 Y
(No pause, exit with errorlevel equal to last two digits of year)
DELAY 0 I 12:00:00 14:00:00
(Return 0 if in hours, 1 if out)
DELAY 0 P 13:00
(Return 0 if 13:00 reached, 255 if ESCape pressed)
DELAY 0 K ABCD 30
(Return 1 if A pressed, 2 if B pressed, 3 if C, 4 if D, 255 if
ESCape, 0 if 30 seconds elapses with no valid key pressed)
Note that besides the obvious uses for DELAY (checking time, date, and
so on), you can use it to "randomize" batch files. Consider this
pseudo-fragment:
DELAY 0 S
IF ERRORLEVEL 30 GOTO DOTHAT
:DOTHIS
REM DO SOMETHING
GOTO DONEDO
:DOTHAT
REM DO SOMETHING ELSE
:DONEDO
M. Kimes 1:380/16.0@fidonet
(318)222-3455 data