<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title>www.ritlabs.com [Topic: Recommend New Macro %eval]</title>
		<link>http://www.ritlabs.com</link>
		<description>New posts in Recommend New Macro %eval of  forum at www.ritlabs.com [www.ritlabs.com]</description>
		<language>en</language>
		<docs>http://backend.userland.com/rss2</docs>
		<lastBuildDateTag>Mon, 28 Jun 2010 14:28:40 +0300</lastBuildDateTag>		<item>
			<title>Recommend New Macro %eval</title>
			<description><![CDATA[<b><a href="http://www.ritlabs.com/en/forums/forum6/topic6968/message31855/">Recommend New Macro %eval</a></b> <i>Recommendation for a new macro</i> in forum <a href="http://www.ritlabs.com/en/forums/forum6/">The Bat! - Templates and Macros</a>. <br />
			Hi all!<br /><br />I've been looking for a way to calculate dates in macros,<br />and this is how I managed to do it with the help of MyMacros plugin:<br /><br />Problem: <br />I would like to add, and subtract, 2 days from today's date, <br />and present the new date automatically in the format of yyyy-mm-dd.<br /><br />Solution:<br />1) %VARtimeback=%CALC="%DATETOCOUNTER(yyyy-mm-dd,%DATE=yyyy-mm-dd) - 2"<br />2) %VARtimeforward=%CALC="%DATETOCOUNTER(yyyy-mm-dd,%DATE=yyyy-mm-dd) + 2"<br />3) %COUNTERTODATE("yyyy-mm-dd","%VARtimeback")<br />4) %COUNTERTODATE("yyyy-mm-dd","%VARtimeforward")<br /><br />Explanation: <br />1) & 2)<br /> %VARtimeback and %VARtimeforward is personally made variables.<br /> %CALC is a built in function, and %DATETOCOUNTER is <br />a part of MyMacros plugin.<br /> You can use any date, even down to minutes and seconds.<br />In this problem, I've only used the yyyy-mm-dd format, and<br />thus only integer numbers.<br />Please see all date formatting possibilities under online help section<br />[Tools\Scheduler\Date and time formats\Macro Date/Time format]<br /><br />3) & 4)<br /> %COUNTERTODATE is a part of MyMacros plugin.<br /><br />3) The output is today's date - 2 days.<br />4) The output is today's date + 2 days.<br /><br />I hope this will help anyone else who needs to calculate dates. <br />
			<i>28 June 2010 14:28:40, <a href="http://www.ritlabs.com/en/forums/">Peter Lebenberg</a>.</i>]]></description>
			<link>http://www.ritlabs.com/en/forums/forum6/topic6968/message31855/</link>
			<guid>http://www.ritlabs.com/en/forums/forum6/topic6968/message31855/</guid>
			<pubDate>Mon, 28 Jun 2010 14:28:40 +0300</pubDate>
			<category>The Bat! - Templates and Macros</category>
		</item>
		<item>
			<title>Recommend New Macro %eval</title>
			<description><![CDATA[<b><a href="http://www.ritlabs.com/en/forums/forum6/topic6968/message26573/">Recommend New Macro %eval</a></b> <i>Recommendation for a new macro</i> in forum <a href="http://www.ritlabs.com/en/forums/forum6/">The Bat! - Templates and Macros</a>. <br />
			did You tried %CALC macro?<br /><br />macro %Eval already existst in MyMacros plugin, but I did not tested it to answer if it does what You want. <br />
			<i>09 January 2009 17:49:01, <a href="http://www.ritlabs.com/en/forums/">Marek Mikus</a>.</i>]]></description>
			<link>http://www.ritlabs.com/en/forums/forum6/topic6968/message26573/</link>
			<guid>http://www.ritlabs.com/en/forums/forum6/topic6968/message26573/</guid>
			<pubDate>Fri, 09 Jan 2009 17:49:01 +0200</pubDate>
			<category>The Bat! - Templates and Macros</category>
		</item>
		<item>
			<title>Recommend New Macro %eval</title>
			<description><![CDATA[<b><a href="http://www.ritlabs.com/en/forums/forum6/topic6968/message26572/">Recommend New Macro %eval</a></b> <i>Recommendation for a new macro</i> in forum <a href="http://www.ritlabs.com/en/forums/forum6/">The Bat! - Templates and Macros</a>. <br />
			Well, there is the %Calc macro, though I don't know how good that is with dates.<br /><br />And the XMP plug-in, downloadable from <noindex><a href="http://www.gaijin.at" target="_blank" rel="nofollow">www.gaijin.at</a></noindex> &nbsp;has a %XMP_TimeCalc macro that might do. <br />
			<i>09 January 2009 17:48:54, <a href="http://www.ritlabs.com/en/forums/">Roelof Otten</a>.</i>]]></description>
			<link>http://www.ritlabs.com/en/forums/forum6/topic6968/message26572/</link>
			<guid>http://www.ritlabs.com/en/forums/forum6/topic6968/message26572/</guid>
			<pubDate>Fri, 09 Jan 2009 17:48:54 +0200</pubDate>
			<category>The Bat! - Templates and Macros</category>
		</item>
		<item>
			<title>Recommend New Macro %eval</title>
			<description><![CDATA[<b><a href="http://www.ritlabs.com/en/forums/forum6/topic6968/message26571/">Recommend New Macro %eval</a></b> <i>Recommendation for a new macro</i> in forum <a href="http://www.ritlabs.com/en/forums/forum6/">The Bat! - Templates and Macros</a>. <br />
			I would like to suggest a new macro named %eval that would add some computations (data and numeric) in the templates. Specifically I'd like to be able to do something like<br /><br />%date(%eval(%date + 1)) to get tomorrow's date to come up. This way I could have a quick template that says:<br /><br />Your order was processed today and will ship on January 10th, 2009.<br /><br />%eval would convert whatever is there into a number. Extend %date macro so that %date(a number) would produce a date again.<br /><br />If there is already a way to do this, I would appreciate any advice on how. Thanks. <br />
			<i>09 January 2009 17:24:02, <a href="http://www.ritlabs.com/en/forums/">Joe Hicks</a>.</i>]]></description>
			<link>http://www.ritlabs.com/en/forums/forum6/topic6968/message26571/</link>
			<guid>http://www.ritlabs.com/en/forums/forum6/topic6968/message26571/</guid>
			<pubDate>Fri, 09 Jan 2009 17:24:02 +0200</pubDate>
			<category>The Bat! - Templates and Macros</category>
		</item>
	</channel>
</rss>
