Good afternoon D De Villiers ! On Sat, 1 Mar 2003 11:44:18 +0200 GMT your local time, which was 01.03.2003, 10:44 (GMT+0100) where I live, you (D Villiers) wrote in mid:[EMAIL PROTECTED]:
> I want to add a LoVe Clock counter to all outgoing TB! emails, which > list the amount of year(s), month(s), week(s) & day(s) since me and my > gf (future whife) been together :-) > How can I do this in TB! ? > I tried %IF, %CALC & &DATE macros but unsuccessful. You were lucky that my spam filter did not see your subject *lol* ok, here we go: there is a set of macros you need to get the days counted. I didn't write these (Carsten, was it you?) nevertheless it counts days in the future but it also works on past events. 1. QT "datediff" %If:_%Comment_>=_%Date='yyyymmdd'_:%- _%comment="a%Comment%-b%Date='yyyymmdd'c0;"_:%- _%comment="a%date='yyyymmdd'b%Comment%c0;"_%- %qinclude="datediff_r"%- %comment="" 2. QT "datediff_addmonth" %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="12":"%- %Calc=!%SetPattRegexp='b(....)'%RegexpMatch='%Comment'+1!":"%- %SetPattRegexp='b(....)'%RegexpMatch='%Comment'"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="01":"02"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="02":"03"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="03":"04"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="04":"05"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="05":"06"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="06":"07"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="07":"08"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="08":"09"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="09":"10"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="10":"11"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="11":"12"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="12":"01"%- %SetPattRegexp='b......(..)'%RegexpMatch='%Comment' 3. QT: "datediff_days" %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="01":"31"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="03":"31"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="04":"30"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="05":"31"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="06":"30"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="07":"31"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="08":"31"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="09":"30"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="10":"31"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="11":"30"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="12":"31"%- %If:"%SetPattRegexp='b....(..)'%RegexpMatch='%Comment'"="02":"%- %If:_%SetPattRegexp=$\D$%RegexpMatch=$%- %Calc=#%SetPattRegexp='b(....)'%RegexpMatch='%Comment'/4#$_=__:%- _%If:#%SetPattRegexp='b..(..)'%RegexpMatch='%Comment'#=#00#:%- #%If:~%SetPattRegexp='b(28|24|20|16|12|08|04|00)'%- %RegexpMatch='%Comment'~<>~~:~29~:~28~#:%- #29#_:_28_" 4. QT: "datediff_r" %REM="Test, ist JJJJMM der beiden Datumswerte identisch?"%- %IF:%- "%SetPattRegexp='a(......)'%RegexpMatch='%Comment'"<=%- "%SetPattRegexp='b(......)'%RegexpMatch='%Comment'%- ":"%- %Rem='Tage addieren/subtrahieren'%- %Calc=_%- %SetPattRegexp='c(.*?);'%RegexpMatch='%Comment'%- +%SetPattRegexp='a......(..)'%RegexpMatch='%Comment'%- -%SetPattRegexp='b......(..)'%RegexpMatch='%Comment'_%- ":"%- %Rem='Monate in Tage umrechnen'%- %Comment='%SetPattRegexp=_(a.*b)_%RegExpMatch=_%Comment_%- %QInclude=!datediff_addmonth!%- c%Calc=!%QInclude=#datediff_days# + %SetPattRegexp=_c(.*?);_%RegexpMatch=_%Comment_!;'%- %QInclude=!datediff_r!"%- 5. QT: "Differenz" %Comment="20020101"%- Since %Qinclude="datediff" days we are a couple Does this help? -- Best regards, Gerd ======================================================= Tutorial for using regular expressions with TheBat! www.regenechsen.de ------------------------------------------------------- Erwerbsregel #42 Verhandle nur, wenn Du sicher bist, Gewinn zu machen. ------------------------------------------------------- now playing: WDR2 :-) ________________________________________________ Current version is 1.62 | "Using TBUDL" information: http://www.silverstones.com/thebat/TBUDLInfo.html