Hallo M,

On Tue, 10 Aug 2004 21:04:43 +0800GMT (10-8-2004, 15:04 +0200, where I
live), you wrote:

MIC> What I'd like it to give me is:

MIC> At 21:17 [GMT+1000] on Monday Aug 09 (Actual time - 19:17 Monday in Perth,
MIC> Western Australia) you wrote:

Create a quick template (QT) called YourTime with these contents:

%SETPATTREGEXP="(?m-s)Date\:((\s*)(.*?),\s*?([\d]{1,2})\s*?(.{3})\s*?([\d]{4})\s*?([\d]{0,2})\:([\d]{0,2})\:([\d]{0,2})(\s*)(.*))"%REGEXPBlindMATCH="%HEADERS"%-
%_YourDay='%SubPatt="3"'%-
%_YourMonthDay='%SubPatt="4"'%-
%_YourMonth='%SubPatt="5"'%-
%_YourYear='%SubPatt="6"'%-
%_YourHour='%SubPatt="7"'%-
%_YourMinute='%SubPatt="8"'%-
%_YourSecond='%SubPatt="9"'%-
%_YourOffset='%SubPatt="11"'%-
%-
%-
%If:"%_YourDay"="Mon":"%_YourDay='Monday'":""%-
%If:"%_YourDay"="Tue":"%_YourDay='Tuesday'":""%-
%If:"%_YourDay"="Wed":"%_YourDay='Wednesday'":""%-
%If:"%_YourDay"="Thu":"%_YourDay='Thursday'":""%-
%If:"%_YourDay"="Fri":"%_YourDay='Friday'":""%-
%If:"%_YourDay"="Sat":"%_YourDay='Saturday'":""%-
%If:"%_YourDay"="Sun":"%_YourDay='Sunday'":""%-
%-
%-
%If:"%_YourMonth"="Jan":"%_YourMonth='January'":""%-
%If:"%_YourMonth"="Feb":"%_YourMonth='February'":""%-
%If:"%_YourMonth"="Mar":"%_YourMonth='March'":""%-
%If:"%_YourMonth"="Apr":"%_YourMonth='April'":""%-
%If:"%_YourMonth"="May":"%_YourMonth='May'":""%-
%If:"%_YourMonth"="Jun":"%_YourMonth='June'":""%-
%If:"%_YourMonth"="Jul":"%_YourMonth='July'":""%-
%If:"%_YourMonth"="Aug":"%_YourMonth='August'":""%-
%If:"%_YourMonth"="Sep":"%_YourMonth='September'":""%-
%If:"%_YourMonth"="Oct":"%_YourMonth='October'":""%-
%If:"%_YourMonth"="Nov":"%_YourMonth='November'":""%-
%If:"%_YourMonth"="Dec":"%_YourMonth='December'":""%-
%-
%-
At %_YourHour:%_YourMinute [GMT%_YourOffset] %-
on %_YourDay %_YourMonth %_YourMonthDay %-
(Actual time - %OTime="hh:mm am/pm" on %-
%OTime="dddd" in Perth, Western Australia) you wrote:


Put this macro in your reply templates:
%Wrapped='%QInclude("YourTime")'
Note that if you give your QT a different name, you have to use that
name in the %QInclude macro.

Here is what the QT does:
%SETPATTREGEXP="(?m-s)Date\:((\s*)(.*?),\s*?([\d]{1,2})\s*?(.{3})\s*?([\d]{4})\s*?([\d]{0,2})\:([\d]{0,2})\:([\d]{0,2})(\s*)(.*))"%REGEXPBlindMATCH="%HEADERS"%-
%_YourDay='%SubPatt="3"'%-

The Date header from the old message gets broken into parts, I've
placed those parts in parameters with logical names like: %_YourDay,
%_YourMonth, etc
So it's easy to see what's the contents of each parameter.

%If:"%_YourDay"="Mon":"%_YourDay='Monday'":""%-
The day in the header is done with three characters, you mentioned
you'd like to have the full names, so I'm checking every option of
%_YourDay and in case of a match I insert the full name.
This could've been done with nested %if statements, but that would be
a lot more complicated and it wouldn't win any substantial time, so I
decided to check seven times.

%If:"%_YourMonth"="Jan":"%_YourMonth='January'":""%-
Same as the day part. But now I'm checking twelve times.

At %_YourHour:%_YourMinute [GMT%_YourOffset] %-
on %_YourDay %_YourMonth %_YourMonthDay %-
(Actual time - %OTime="hh:mm am/pm" on %-
%OTime="dddd" in Perth, Western Australia) you wrote:

This is your actual greeting line. Note that the parameter
%_YourSecond isn't used, the reason that I broke the original time in
seconds too was that it'll make the QT easier to alter.


%Wrapped='%QInclude("YourTime")'

The QInclude macro calls the QT, the Wrapped macro wraps the output of
the QT according to your wrapping settings.


MIC> With the 'evening' bit changing depending on the time of day? (ie 0-11 =
MIC> "morning", 12-16 = "afternoon", 17-20 = "evening", 21-23 = "night")

MIC> Or is that just being stupid(er)?

That can be done, it's merely a slight adaption of the QT, but I think
it's rather silly.

-- 
Groetjes, Roelof

The Bat! 2.13 "Lucky" Beta/4
Windows XP 5.1 Build 2600 Service Pack 1
1 pop3 account, server on LAN

Disclaimer: Any opinion stated in this message is not necessarily shared by my budgies 
or rabbits.


________________________________________________
Current version is 2.12.00 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to