Hello Chris,

On Thursday, June 27, 2002 at 21:57 GMT +0100, an infinite number of
monkeys posting as Chris Weaven [CW] typed:

CW> 1. How do I call this from the quick templates rather than pasting it
CW> directly into the reply/forward template?

To start, I apologize to the moderators if this is getting too
technical for this list. Any discussion of the following should
probably continue on the TBTECH list.

I don't really understand your question, so I apologize if I've
over-simplified.  Copy (Ctrl-C) the macro, then go to:
 -> Options
   -> Quick Templates
     -> Add
Then give it a name, and paste in the macro (Ctrl-V).

Once you have it in a QT, you can use it in other templates using
%QINCLUDE="<whatever_name>".  Alternatively, you can execute the
template directly into any message by typing the template's name, then
<ctrl><space>.  So for example, suppose I had given the QT's handle as
"Time" (without the quotes).  Then I can type "Time<ctrl><space>" and
the output would be:
You wrote On Thu, 27 Jun 2002, at 21:57 [GMT +0100] (1:57:59 PM June 27, 2002 where I 
live):-

CW> 2. Rather than have 'Thu', I'd rather have Thursday?

That is significantly harder and uses a rather complex quick template
system.  To create the GMT date string, you'd use the following QT.

====[QT Date]====
%REM="Do the translation of the weekday"%-
%Comment="%-
%-%-%SETPATTREGEXP='(?im-s)^Date\:\s*(...)'%-
%-%-%REGEXPMATCH='%Headers'"%-
%-
%IF:"%Comment"="Sun":"Sunday":""%-
%IF:"%Comment"="Mon":"Monday":""%-
%IF:"%Comment"="Tue":"Tuesday":""%-
%IF:"%Comment"="Wed":"Wednesday":""%-
%IF:"%Comment"="Thu":"Thursday":""%-
%IF:"%Comment"="Fri":"Friday":""%-
%IF:"%Comment"="Sat":"Saturday":"", %-
%-
%REM="Do Month translation"%-
%Comment="%-
%SETPATTREGEXP='(?im-s)^Date\:.*?\,[\s\d]*(\S*)'%-
%REGEXPMATCH='%Headers'"%-
%-
%IF:"%Comment"="Jan":"January":""%-
%IF:"%Comment"="Feb":"February":""%-
%IF:"%Comment"="Mar":"March":""%-
%IF:"%Comment"="Apr":"April":""%-
%IF:"%Comment"="May":"May":""%-
%IF:"%Comment"="Jun":"June":""%-
%IF:"%Comment"="Jul":"July":""%-
%IF:"%Comment"="Aug":"August":""%-
%IF:"%Comment"="Sep":"September":""%-
%IF:"%Comment"="Oct":"October":""%-
%IF:"%Comment"="Nov":"November":""%-
%IF:"%Comment"="Dec":"December":"" %-
%-
%REM="Include date"%-
%SETPATTREGEXP="(?im-s)^Date\:.*?\,\s*(\d*)"%-
%REGEXPMATCH="%Headers", %-
%-
%REM="Add in Year"%-
%SETPATTREGEXP="(?im-s)^Date\:.*?(\d{4})"%-
%REGEXPMATCH="%Headers"%-
%-
%Comment=""%-
====[End]====

The above template gives you: Thursday, June 27, 2002
So now you need to extract the time.  Here is part of the one I use:

====[QT Time]====
%SETPATTREGEXP="(?im-s)^Date\:.*?([\d]{0,2}\:[\d]{0,2})\:[\d]{0,2}.*?([-+]\d{4})"%-
%REGEXPBLINDMATCH="%HEADERS"%-
%SUBPATT="1" GMT %SUBPATT="2"%-
====[End]====

That template gives you: 21:57 GMT +0100

CW> 3. I'd also like to add the day in the bit 'where I live' because the
CW> time difference could result in it being a different day.

Ok, that can be done by using:
%ODATE='dddd, mmmm d, yyyy "at" h:nn am/pm'
Which gives: Thursday, June 27, 2002 at 1:57 pm

So the line you'd put into your main template would be something like:

You wrote on %QINLUDE="Date", at %QINCLUDE="Time" (%ODATE="dddd, %-
mmmm d, yyyy ""at"" h:nn am/pm" where I live):


-- 
Thanks for writing,
 Januk Aggarwal

I've determined the momentum of my physics assignment so precisely
that it can be anywhere in the universe right now.


________________________________________________________
Current Ver: 1.60q
FAQ        : http://faq.thebat.dutaint.com 
Unsubscribe: mailto:[EMAIL PROTECTED]
Archives   : http://tbudl.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
TBTech List: mailto:[EMAIL PROTECTED]
Bug Reports: https://www.ritlabs.com/bt/

Reply via email to