home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware 1 2 the Maxx
/
sw_1.zip
/
sw_1
/
UTILS
/
FDATE61A.ZIP
/
TIC.BAT
< prev
Wrap
DOS Batch File
|
1992-02-15
|
7KB
|
187 lines
@echo off
goto endcomment
revision history
================
Jan 7, 1992
Added ADDDOW function for regular weekly appointments
Jan 12, 1992
Removed all /Od1 and /Imm-dd-ccyy, which are now defaults
Jan 15, 1992
Added ability to accept +1, etc. as parms
Jan 22, 1992
Fixed ability to list by date, which had been messed up when
adding ability to accept +1, etc. as parms
Feb 14, 1992
replaced calls to batch files with use of new /V parm
:endcomment
REM TicBAT points to the tickler batch file
set TicBAT=C:\TICKLER.BAT
set ticdat=
set ticdow=
set ticmsg=
set tictmp=
REM ECHO PARM1 IS %1 AND PARM2 IS %2 AND PARM3 IS %3
if (%1)==() goto HELP
for %%v in (t+1 T+1) do if (%%v)==(%1) %0 T +1
for %%v in (t+2 T+2) do if (%%v)==(%1) %0 T +2
for %%v in (t+3 T+3) do if (%%v)==(%1) %0 T +3
for %%v in (t+4 T+4) do if (%%v)==(%1) %0 T +4
for %%v in (t+5 T+5) do if (%%v)==(%1) %0 T +5
for %%v in (t+6 T+6) do if (%%v)==(%1) %0 T +6
for %%v in (t+7 T+7) do if (%%v)==(%1) %0 T +7
for %%v in (ed Ed ED edit Edit EDIT) do if (%%v)==(%1) goto EDIT
for %%v in (t T today TODAY Today ) do if (%%v)==(%1) goto LIST
for %%v in (dow DOW Dow DoW) do if (%%v)==(%1) goto adddow
if (%2)==() goto LIST
:ADD
rem -------------------------------------------------------------
rem use a batch file to set ticdat, because it will display full error
rem message if bad date has been passed in via parm %1
rem -------------------------------------------------------------
Fdate /Ff /A%1 /Imm-dd-yy /Omm-dd-ccyy /Vticdat
if errorlevel 1 goto endit
set tictmp=%0 %1
shift
set ticmsg=%1
shift
:LOOPTOP1
if (%1)==() goto LOOPEND1
set ticmsg=%ticmsg% %1
shift
goto LOOPTOP1
:LOOPEND1
if exist %TicBAT% goto exists1
echo @echo off >> %TicBAT%
:exists1
echo if (%%today%%)==(%ticdat%) echo %ticmsg%>>%TicBAT%
CLS
%tictmp%
goto endit
:ADDDOW
set tictmp=%0 %1
rem -------------------------------------------------------------
rem use a batch file to set ticdat, because it will display full error
rem message if bad date has been passed in via parm %1
rem -------------------------------------------------------------
set ticdow=
for %%v in ( 1 2 3 4 5 6 7 ) do if (%2)==(%%v) set ticdow=%2
if (%ticdow%)==() echo Invalid day-of-week number: %2
if (%ticdow%)==() goto endit
shift
shift
set ticmsg=%1
shift
:LOOPTOP2
if (%1)==() goto LOOPEND2
set ticmsg=%ticmsg% %1
shift
goto LOOPTOP2
:LOOPEND2
IF (%TICDOW%)==(1) SET TICMSG=%ticmsg% [REGULAR SUNDAY APPOINTMENT]
IF (%TICDOW%)==(2) SET TICMSG=%ticmsg% [REGULAR MONDAY APPOINTMENT]
IF (%TICDOW%)==(3) SET TICMSG=%ticmsg% [REGULAR TUESDAY APPOINTMENT]
IF (%TICDOW%)==(4) SET TICMSG=%ticmsg% [REGULAR WEDNESDAY APPOINTMENT]
IF (%TICDOW%)==(5) SET TICMSG=%ticmsg% [REGULAR THURSDAY APPOINTMENT]
IF (%TICDOW%)==(6) SET TICMSG=%ticmsg% [REGULAR FRIDAY APPOINTMENT]
IF (%TICDOW%)==(7) SET TICMSG=%ticmsg% [REGULAR SATURDAY APPOINTMENT]
if exist %TicBAT% goto exists2
echo @echo off >> %TicBAT%
:exists2
echo if (%%ticdow%%)==(%ticdow%) echo %ticmsg%>>%TicBAT%
CLS
echo Added: %ticmsg%
goto endit
:HELP
REM use ansi.sys to set color to blue
echo
cls
echo ┌─────────────────────────────────────────────────────────────────────────────┐
echo │ TIC.BAT : maintains and displays TICKLER.BAT, an automated tickler file. │
echo │═════════════════════════════════════════════════════════════════════════════│
echo │ Usage : TIC displays this HELP screen │
echo │─────────────────────────────────────────────────────────────────────────────│
echo │ Usage : TIC T displays today's appointments │
echo │ Usage : TIC T +1 displays tomorrow's appointments │
echo │─────────────────────────────────────────────────────────────────────────────│
echo │ Usage : TIC ED (or TIC EDIT) calls text editor to edit TICKLER.BAT │
echo │─────────────────────────────────────────────────────────────────────────────│
echo │ Usage : TIC mm/dd/yy displays appointments for date mm/dd/yy │
echo │ EXAMPLE : TIC 2/2/92 displays appointments for Feb 2, 1992 │
echo │ EXAMPLE : TIC 2/2/tt displays appointments for Feb 2 of this year │
echo │─────────────────────────────────────────────────────────────────────────────│
echo │ Usage : TIC mm/dd/yy words ... adds an appointment for date │
echo │ [mm/dd/yy] to TICKLER.BAT │
echo │ EXAMPLE : TIC 2/2/92 Quality Improvement committee meeting @ 10 am │
echo │ EXAMPLE : TIC 2/2/tt Quality Improvement committee meeting @ 10 am │
echo │─────────────────────────────────────────────────────────────────────────────│
echo │ Usage : TIC DOW dow# words ... adds a regular appointment │
echo │ for [dow#] day to TICKLER.BAT │
echo │ EXAMPLE : TIC DOW 2 Regular Monday-morning staff meeting @ 8:30 │
echo └─────────────────────────────────────────────────────────────────────────────┘
REM use ansi.sys to set color to normal default colors
echo
A
goto endit
REM ==================================================================
:EDIT
SPFPC %TicBAT%
goto endit
REM ==================================================================
:LIST
if not exist %TicBAT% goto endit
for %%v in (t T today TODAY Today ) do if (%%v)==(%1) goto LISTPLUS
goto LISTDATE
:LISTPLUS
set TICfut=0
for %%v in (+1 +2 +3 +4 +5 +6 +7) do if (%2)==(%%v) set TICfut=%%v
for %%v in (-1 -2 -3 -4 -5 -6 -7) do if (%2)==(%%v) set TICfut=%%v
for %%v in ( 1 2 3 4 5 6 7) do if (%2)==(%%v) set TICfut=%%v
Fdate /Fadd /At /N%TICfut% /Omm-dd-ccyy /Vtoday
set TICfut=
goto LISTIT
:LISTDATE
Fdate /Ff /A%1 /Imm-dd-yy /Omm-dd-ccyy /Vtoday
:LISTIT
if (%today%)==(ERROR) echo Invalid date parameter [%1] received by %0
if (%today%)==(ERROR) goto endit
rem ------- call batch file to set ticdow Evar -------
Fdate /Ff /A%today% /Odow# /Vticdow
echo ───────────────────────────────────────────────────────────────────────────────
FDATE /Ff /A%today% /P"APPOINTMENTS & THINGS TO DO: "
echo ───────────────────────────────────────────────────────────────────────────────
CALL %TicBAT%
:endit
set ticdow=
set fdate=
set ticdat=
set ticmsg=
set TicBAT=