@echo off
goto EndDoC
---------------------------------------------------------------------
If environment variable RAMDISK is set before running this batch
file, then it will use the RAM disk and run a bit faster.

revision history
================
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
Mar 25, 1992
    Changed date format from mm-dd-ccyy to ccyy-mm-dd
    This makes it easier to sort tickler.bat by date
    NOTE THAT THIS IS INCOMPATIBLE WITH EARLIER VERSIONS OF TIC
    Use "TIC EDIT" to edit old dates in TICKLER.BAT
May 1 , 1992
    slightly re-arranged things to make it run faster
---------------------------------------------------------------------
:EndDoC

REM TicBAT points to the tickler batch file
set TicBAT=C:\TICKLER.BAT
set ticdat=
set ticdow=
set ticmsg=
set tictmp=

if (%1)==(t) goto listplus
IF (%1)==(T) GOTO LISTPLUS
for %%v in (today TODAY Today  ) do if (%%v)==(%1) goto LISTPLUS

for %%v in (ed Ed ED edit Edit EDIT) do if (%%v)==(%1) goto EDIT
for %%v in (dow DOW Dow DoW) do if (%%v)==(%1) goto adddow
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
if (%2)==() goto LISTDATE
goto add

:LISTDATE
if not exist %TicBAT% goto endit
Fdate /Ff /A%1 /Imm-dd-yy /Occyy-mm-dd /P"@set today=" >%RAMDISK%JUNKTEMP.BAT
call %RAMDISK%JUNKTEMP.BAT
goto LISTIT

:LISTPLUS
if not exist %TicBAT% goto endit

set TICFUT=%2
IF (%ticfut%)==() SET TICFUT=0

Fdate /Fadd /At /N%TICfut% /Occyy-mm-dd /P"@set today=" >%RAMDISK%JUNKTEMP.BAT
call %RAMDISK%JUNKTEMP.BAT
set TICfut=
rem fall thru ...

:LISTIT
if (%today%)==(ERROR) goto ERROR1

rem ------- call batch file to set ticdow Evar -------
Fdate /Ff /A%today% /Odow# /Iccyy-mm-dd /P"@set ticdow=">%RAMDISK%JUNKTEMP.BAT
call %RAMDISK%JUNKTEMP.BAT

echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
FDATE /Ff /A%today% /Iccyy-mm-dd /P"APPOINTMENTS & THINGS TO DO: "
echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
CALL %TicBAT%
goto endit

:ERROR1
echo Invalid date parameter [%1] received by %0
goto endit

: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 /Occyy-mm-dd /P"@set ticdat=" >%RAMDISK%JUNKTEMP.BAT
call %RAMDISK%JUNKTEMP.BAT
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 [1;44;37m
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 [0;40;37m [1A
goto endit

:EDIT
SPFPC %TicBAT%
goto endit

:endit
set ticdow=
set fdate=
set ticdat=
set ticmsg=
set TicBAT=
if exist %RAMDISK%JUNKTEMP.BAT del %RAMDISK%JUNKTEMP.BAT >nul
