WHEN

The errorlevel of a time-of-day question.

C:\> WHEN 9 12:30 13 17 d23456

C:\> WHEN 9 12:30 13 17 d23456
C:\> echo ERRORLEVEL is 13
ERRORLEVEL is 13

Today is not in the D list: code 13 (not in WHEN.DOC; no TeleBox field uses it, so the 'disposition' runs).

EXAMPLES

WHEN.DOC's example: a business open on weekdays
no arguments: the day of the week
only a day list: 0 on weekdays, 13 otherwise
times must increase: 11 (error)
D written BEFORE the times: the original reads an unwritten minute slot (usually 11)

WHEN.DOC'S TABLE FOR WHEN 9 12:30 13 17 d23456

codewhen (Monday to Friday)
1From 12:00 AM through 8:59 AM
2From 9:00 AM through 12:29 PM
3From 12:30 PM through 12:59 PM
4From 1:00 PM through 4:59 PM
5From 5:00 PM through 11:59 PM

On weekends (Saturday, Sunday) the example does not match the D list: the disposition of the TeleBox is executed (code 13). The document writes the command as WHEN.COM/9 12:30 13 17 d23456: the slash is BigmOuth's separator between the program and its arguments.

ABOUT THIS TOOL

Recreates
WHEN.COM, a TeleBox helper for BigMouth's "E - Execute TeleBox", Talking Technology, Inc. (Microsoft C, tiny model).
Date
29 Aug 1991 (WHEN.COM); 3 Feb 1992 (WHEN.DOC)
Who likely wrote it
Talking Technology, Inc.
What changed in the web version
  • It is a calculator: pick the clock and the arguments, see the errorlevel. The real program read the DOS clock; here you can type any day and time.
Kept on purpose (the original's bugs and habits)
  • Times and day-of-week arguments are both stored in arrays, but the minutes by ARGUMENT position and the hours by TIME number: a D argument written before the times makes the minute check read garbage (usually code 11). WHEN.DOC puts D last.
  • 13 is returned when today is not in the D list. WHEN.DOC never mentions it.
  • "13" means 13:00 (a missing minutes field reads as 0).
Ground truth
inventory/exe_c/vendor_tools/WHEN/ and WHEN.DOC