On 29 August 2008, 03:07, Rick wrote:

> Interesting ... I have thought it would be interesting to have a
> counter - count down to an event for instance or count up (how many
> days since) in a cookie. I have not thought it a serious enough enough
> feature to suggest it :))
~~~

That's fairly easily done if you have an application that can
independently maintain a text file that contains the cookie. You then
use a PUT macro to insert the content of the text file into your
message.

For example, for a countdown to Christmas you could use the following
VBScript:

Dim Christmas, DaysToGo, Cookie, fso, f
Christmas = CDate("25 December 2008")
DaysToGo = DateDiff("d", Now, Christmas)
If DaysToGo > 0 Then
  Cookie = DaysToGo & " days until Christmas"
ElseIf DaysToGo < 0 Then
  Cookie = DaysToGo & " days since Christmas"
Else
  Cookie = "Happy Christmas!"
End If
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateTextFile("C:\temp\countdown.txt", True)
f.Write Cookie
f.Close
Set f = Nothing
Set fso = Nothing

If you save that as (say) C:\temp\countdown.vbs you can call this with
the command
  wscript c:\temp\countdown.vbs //B
(//B suppresses any dialog boxes the script might show) You can run
this as a scheduled task under Windows. In your template, include the
macro:
%PUT="C:\temp\countdown.txt"

This should be easy to modify to get a "countdown cookie" for your own
purposes.

HTH,

-- 
Geoff Lane
Cornwall, UK
--
Using The Bat! v1.62r on Windows XP 5.1 Build 2600 Service Pack 3
UK and USA - two countries divided by a common language


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

Reply via email to