/* Arexx - KBE Reminder BDay/Holi Checker */ dy_in_mnth.1=31 dy_in_mnth.2=28 dy_in_mnth.3=31 dy_in_mnth.4=30 dy_in_mnth.5=31 dy_in_mnth.6=30 dy_in_mnth.7=31 dy_in_mnth.8=31 dy_in_mnth.9=30 dy_in_mnth.10=31 dy_in_mnth.11=30 dy_in_mnth.12=31 urglis=0 norlis=0 mldlis=0 curyear = substr(date('S'),1,4) if exists('s:Reminder.DAT') then do if open('pafil','s:Reminder.DAT','r') then do hedr=readln('pafil') if substr(hedr,1,9) = "KBErmPath" then do pth=substr(hedr,10) orig_path=pragma('d',pth) end end end say '1b'x||"[4m"||'1b'x||"[1mCLI-Reminder"||'1b'x||"[22m - Birthday and Holiday checker v1.0"||'1b'x||"[0m" say '1b'x||"[32m©1993 KBE Software - Written by Damon Bennett"||'1b'x||"[0m" if open('datfil','Birthdays.Data','r') then do hedr=readln('datfil') if substr(hedr,1,7)="KBErmBd" then do num_recs=strip(substr(hedr,8),'t','0d'x) tmvl=readln('datfil') advd=substr(tmvl,1,2) advm=substr(tmvl,3,2) advw=substr(tmvl,5,1) actw=substr(tmvl,6,1) do for num_recs exps=readln('datfil') ttls=readln('datfil') if ttls ~="" then do mild=0 norm=0 urgn=0 expy=curyear expm=substr(exps,3,2) expd=substr(exps,1,2) tmpvr=advanc_ok() if tmpvr=1 then do if advw='M' then mild=1 if advw='N' then norm=1 if advw='U' then urgn=1 end if tmpvr=2 then do if actw='M' then mild=1 if actw='N' then norm=1 if actw='U' then urgn=1 end if urgn then do urglis=urglis+1 urgnam.urglis = ttls urgexp.urglis = date('n',curyear||expm||expd,'s') norm=0 mild=0 end if norm then do norlis=norlis+1 nornam.norlis = ttls norexp.norlis = date('n',curyear||expm||expd,'s') mild=0 end if mild then do mldlis=mldlis+1 mldnam.mldlis = ttls mldexp.mldlis = date('n',curyear||expm||expd,'s') end end end call close('datfil') end end if urglis>0 then do urglis=urglis+1 urgnam.urglis="**&&BlAnK&&**" end if norlis>0 then do norlis=norlis+1 nornam.norlis="**&&BlAnK&&**" end if mldlis>0 then do mldlis=mldlis+1 mldnam.mldlis="**&&BlAnK&&**" end if open('datfil','Holidays'||curyear||'.Data','r') then do hedr=readln('datfil') if substr(hedr,1,7)="KBErmHl" then do num_recs=strip(substr(hedr,8),'t','0d'x) tmvl=readln('datfil') advd=substr(tmvl,1,2) advm=substr(tmvl,3,2) advw=substr(tmvl,5,1) actw=substr(tmvl,6,1) do for num_recs exps=readln('datfil') ttls=readln('datfil') if ttls ~="" then do mild=0 norm=0 urgn=0 expy=curyear expm=substr(exps,3,2) expd=substr(exps,1,2) tmpvr=advanc_ok() if tmpvr=1 then do if advw='M' then mild=1 if advw='N' then norm=1 if advw='U' then urgn=1 end if tmpvr=2 then do if actw='M' then mild=1 if actw='N' then norm=1 if actw='U' then urgn=1 end if urgn then do urglis=urglis+1 urgnam.urglis = ttls urgexp.urglis = date('n',curyear||expm||expd,'s') norm=0 mild=0 end if norm then do norlis=norlis+1 nornam.norlis = ttls norexp.norlis = date('n',curyear||expm||expd,'s') mild=0 end if mild then do mldlis=mldlis+1 mldnam.mldlis = ttls mldexp.mldlis = date('n',curyear||expm||expd,'s') end end end call close('datfil') end end if urglis>0 then do if open('wno',"con:0/0/620/"||60+(8*urglis)||"/CLI-Reminder - URGENT Birthdays & Holidays for" date(),'w') then do call pragma("*",'wno') if open('wni',"*",'r') then do writeln('wno','1b'x||"[33m"||copies("URGENT...",8)||'1b'x||"[0m") writeln('wno',"Todays urgent reminders... Expiry date...") if open('spo',"SPEAK:opt/s200","w") then do do dumc=1 to urglis txot=strip(urgnam.dumc,'t','0d'x) if substr(txot,1,13)~="**&&BlAnK&&**" then do writeln('wno','1b'x||"[32m"||txot||'1b'x||"[0m" copies('.',59-length(urgnam.dumc)) urgexp.dumc) writeln('spo',urgnam.dumc) end else writeln('wno',' ') end call close('spo') end writeln('wno',"Press RETURN when you are ready to continue....") dumv=readln('wni') call close('wni') end call pragma("*") call close('wno') end end if norlis>0 then do if open('wno',"con:0/0/620/"||50+(8*norlis)||"/CLI-Reminder - Birthdays & Holidays for" date(),'w') then do call pragma("*",'wno') if open('wni',"*",'r') then do writeln('wno',"Todays normal reminders... Expiry date...") do dumc=1 to norlis txot=strip(nornam.dumc,'t','0d'x) if substr(txot,1,13)~="**&&BlAnK&&**" then writeln('wno',txot copies('.',59-length(nornam.dumc)) norexp.dumc) else writeln('wno',' ') end writeln('wno',"Press RETURN when you are ready to continue....") dumv=readln('wni') call close('wni') end call pragma("*") call close('wno') end end if mldlis>0 then do say "Todays mild reminders for" date() " Expiry date..." do dumc=1 to mldlis txot=strip(mldnam.dumc,'t','0d'x) if substr(txot,1,13)~="**&&BlAnK&&**" then say strip(mldnam.dumc,'t','0d'x) copies('.',59-length(mldnam.dumc)) mldexp.dumc else say ' ' end end exit /* PROGRAM PROCEDURE and FUNCTION SECTION .... */ advanc_ok: wky=expy wkm=expm-advm if wkm<1 then do wkm=12-(abs(wkm)+1) wky=wky-1 end wkd=expd-advd if wkd<1 then do wkm=wkm-1 if wkm<1 then do wkm=12-(abs(wkm)+1) wky=wky-1 end wkd=dy_in_mnth.wkm-abs(wkd) if (1989-wky) // 4=1 & wkm=2 then wkd=29-abs(wkd) end if wky<1989 then do wky=1989 wkm=1 wkd=1 end if length(wkm)=1 then wkm='0'||wkm if length(wkd)=1 then wkd='0'||wkd res=0 if date('i') <= date('i',expy||expm||expd,'s') then do if date('i') >= date('i',wky||wkm||wkd,'s') then res=1 end if date('i') = date('i',expy||expm||expd,'s') then res=2 return res