<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Clarion Edge &#187; Examples</title>
	<atom:link href="http://www.clarionedge.com/category/clarion/examples/feed" rel="self" type="application/rss+xml" />
	<link>http://www.clarionedge.com</link>
	<description>Get an Edge with Clarion!</description>
	<lastBuildDate>Thu, 29 Jul 2010 21:13:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A clarion version of System.AddMonths</title>
		<link>http://www.clarionedge.com/clarion/a-clarion-version-of-systemaddmonths.html</link>
		<comments>http://www.clarionedge.com/clarion/a-clarion-version-of-systemaddmonths.html#comments</comments>
		<pubDate>Fri, 20 Nov 2009 17:10:25 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[Clarion]]></category>
		<category><![CDATA[Examples]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/uncategorized/a-clarion-version-of-systemaddmonths.html</guid>
		<description><![CDATA[Today at work I needed some code to Add “x” months to a given date. System.AddMonths looked like the kind of thing I was after but I needed it implemented in clarion code.
Not hard but [...]]]></description>
			<content:encoded><![CDATA[<p>Today at work I needed some code to Add “x” months to a given date. <a href="http://msdn.microsoft.com/en-us/library/system.datetime.addmonths.aspx" target="_blank">System.AddMonths</a> looked like the kind of thing I was after but I needed it implemented in clarion code.</p>
<p>Not hard but nice to have.</p>
<p>Thanks Mark for the assistance!</p>
<p>Some examples:</p>
<ol>
<li>05-Oct-2009 + 1 Month = 05-Nov-2009</li>
<li>31-Oct-2990 + 1 Month = 30-Nov-2009</li>
</ol>

<div class="wp_syntax"><div class="code"><pre class="clarion" style="font-family:monospace;">AddMonths <span style="color: #000080;">PROCEDURE</span>  (<span style="color: #000080;">LONG</span> pDate, <span style="color: #000080;">BYTE</span> pMonths) <span style="color: #008000;">!,LONG</span>
originalDay <span style="color: #000080;">BYTE</span>
returnDate  <span style="color: #000080;">LONG</span>
  <span style="color: #000080;">CODE</span>
  originalDay = <span style="color: #000080;">Day</span>(pDate)
&nbsp;
  returnDate = <span style="color: #000080;">Date</span>(<span style="color: #000080;">Month</span>(pDate) + pMonths, <span style="color: #000080;">Day</span>(pDate), <span style="color: #000080;">Year</span>(pDate))
&nbsp;
  <span style="color: #000080;">IF</span> <span style="color: #000080;">Day</span>(returnDate) &lt;&gt; originalDay
    returnDate = <span style="color: #000080;">Date</span>(<span style="color: #000080;">Month</span>(returnDate), 1,  <span style="color: #000080;">Year</span>(returnDate)) - 1
  <span style="color: #000080;">END</span>
&nbsp;
  <span style="color: #000080;">RETURN</span> returnDate</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/clarion/a-clarion-version-of-systemaddmonths.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Embedding Mozilla in a Clarion Window</title>
		<link>http://www.clarionedge.com/clarion/examples/embedding-mozilla.html</link>
		<comments>http://www.clarionedge.com/clarion/examples/embedding-mozilla.html#comments</comments>
		<pubDate>Sun, 15 Mar 2009 13:08:22 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[Examples]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/?p=214</guid>
		<description><![CDATA[Here is a very quick and dirty example of embedding a web browser control in a clarion window.
To use the Mozilla example you will need to download and install the Mozilla ActiveX Control from here:
http://www.iol.ie/~locka/mozilla/control.htm#download
Enjoy!




Download:
 [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a very <strong><em>quick and dirty</em></strong> example of embedding a web browser control in a clarion window.</p>
<p>To use the Mozilla example you will need to download and install the Mozilla ActiveX Control from here:</p>
<p><a href="http://www.iol.ie/~locka/mozilla/control.htm#download" target="_blank">http://www.iol.ie/~locka/mozilla/control.htm#download</a></p>
<p>Enjoy!</p>
<div class="download">
<table border="0">
<tbody>
<tr>
<th>Download:</th>
<td><a rel="nofollow" title="Download version 0.1 of EmbMozilla.app" href="http://www.clarionedge.com/downloads/examples/EmbMozilla.app"><img src="http://www.clarionedge.com/wp-content/plugins/drain-hole/images/download.png" alt="download" width="128" height="128"/></a> <a rel="nofollow" title="Download version 0.1 of EmbMozilla.app" href="http://www.clarionedge.com/downloads/examples/EmbMozilla.app">EmbMozilla.app</a></td>
</tr>
<tr>
<th>Version:</th>
<td>0.1</td>
</tr>
<tr>
<th>Updated:</th>
<td>March 16, 2009</td>
</tr>
<tr>
<th>Size:</th>
<td>48.25 KB</td>
</tr>
<tr>
<th>Downloads:</th>
<td>168</td>
</tr>
<tr>
<th>Details:</th>
<td>Clarion App file created with Clarion 6.3</td>
</tr>
</tbody>
</table>
</div>
<div class="download">
<table border="0">
<tbody>
<tr>
<th>Download:</th>
<td><a rel="nofollow" title="Download version 0.1 of EmbMozilla.exe" href="http://www.clarionedge.com/downloads/examples/EmbMozilla.exe"><img src="http://www.clarionedge.com/wp-content/plugins/drain-hole/images/download.png" alt="download" width="128" height="128"/></a> <a rel="nofollow" title="Download version 0.1 of EmbMozilla.exe" href="http://www.clarionedge.com/downloads/examples/EmbMozilla.exe">EmbMozilla.exe</a></td>
</tr>
<tr>
<th>Version:</th>
<td>0.1</td>
</tr>
<tr>
<th>Updated:</th>
<td>March 16, 2009</td>
</tr>
<tr>
<th>Size:</th>
<td>1.03 MB</td>
</tr>
<tr>
<th>Downloads:</th>
<td>146</td>
</tr>
<tr>
<th>Details:</th>
<td>Executable compiled with Clarion 6.3. in local mode so it should run as is. (Don&#8217;t forget to install the mozilla OCX!)</td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/clarion/examples/embedding-mozilla.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>#RUN parameter limits and hiding command windows</title>
		<link>http://www.clarionedge.com/windows/tools/run-and-command-windows.html</link>
		<comments>http://www.clarionedge.com/windows/tools/run-and-command-windows.html#comments</comments>
		<pubDate>Sun, 08 Feb 2009 20:23:23 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[Templates]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/?p=192</guid>
		<description><![CDATA[Recently I have been doing a fair amount of work trying to automate parts of the development process, in particular the version control aspects. I ran into what appeared to be limitations in the length [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been doing a fair amount of work trying to automate parts of the development process, in particular the version control aspects. I ran into what appeared to be limitations in the length of parameters accepted by the Clarion templates #RUN statement. Searching the newsgroups there were a few comments from people having similar issues and the symptoms were seemed a little sporadic. I decided that the safest way was to write the commands out to a temporary batch file and use #RUN to just call that.<br />
<span id="more-192"></span><br />
This works great and has the added advantage of being able to execute, obviously, batches of commands in one go.  The thing that is annoying about this is that you <em>will</em> get the command window popping up when the command is run. Often this is fine, especially for long tasks where it is nice to see the progress but sometimes it is annoying and it would to be nice to be able to hide the window.</p>
<p>There are a few ways to do this but essentially they all seem to revolve around the <a href="http://msdn.microsoft.com/en-us/library/ms682425.aspx" target="_blank">CreateProcess</a> api Function.</p>
<ol>
<li>Write a helper DLL that wraps the CreateProcess function and can be easily called by the templates.</li>
<li>Find something that already does this so I don&#8217;t have to.</li>
</ol>
<p>If you want to go for option 1 in clarion you might like to look into <a href="http://www.berthume.com/powerrun.htm" target="_blank">PowerRun</a> from Berthume Software which is available for free download. And of course you can dig right in and make the function call directly.  However, if there is something suitable around I much prefer to use that.</p>
<p>After a quick search I found these two options:</p>
<ul>
<li>CHP.EXE (Create Hidden Process) &#8211; <a href="http://www.commandline.co.uk/chp/" target="_blank">http://www.commandline.co.uk/chp/</a></li>
<li>hidden Start (hstart.exe) &#8211; <a href="http://www.ntwind.com/software/utilities/hstart.html" target="_blank">http://www.ntwind.com/software/utilities/hstart.html</a></li>
</ul>
<p>I tried CHP first and it certainly does what it says it will but I found I wanted the option to wait until the spawned task was finished. In comes hstart. Hstart is pretty awesome. Lots of options and it also, funnily enough, does what it says it will&#8230;</p>
<p style="text-align: center;"><a href="http://www.clarionedge.com/wp-content/uploads/hstart_help21.png"><img class="size-medium wp-image-196 aligncenter" title="hstart_help21" src="http://www.clarionedge.com/wp-content/uploads/hstart_help21-242x246.png" alt="hstart_help21" width="242" height="246" /></a></p>
<p>For anyone interested, this is the template code I ended up with for calling hidden commands in a clarion template:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="clarion" style="font-family:monospace;">#GROUP(%RunCommandHidden, %<span style="color: #000080;">Command</span>, %TestMode=%FALSE),<span style="color: #000080;">AUTO</span>
<span style="">#!</span>
<span style="color: #800080;">#DECLARE</span>(%BatchFileName)
<span style="">#! We need to write the command out to a batch file for execution because</span>
<span style="">#! the #RUN command seems to have issues with the length of the command!</span>
<span style="color: #800080;">#SET</span>(%BatchFileName, <span style="color: #008000;">'run.bat')
</span><span style="color: #800080;">#SET</span>(%BatchFileName, FullName(%BatchFileName, 2))
#CREATE(%BatchFileName)
%<span style="color: #000080;">Command</span>
#CLOSE(%BatchFileName)
<span style="">#! Now we call the batch file for execution</span>
<span style="">#! using cph.exe for &quot;Create Hidden Process&quot;</span>
<span style="color: #800080;">#IF</span>(%TestMode=%FALSE)
  #RUN(<span style="color: #008000;">'hstart.exe /NOCONSOLE /WAIT ' &amp; %BatchFileName),WAIT
</span><span style="color: #800080;">#ELSE</span>
  #RUN(<span style="color: #008000;">'hstart.exe /WAIT ' &amp; %BatchFileName),WAIT
</span><span style="color: #800080;">#ENDIF</span>
#REMOVE(%BatchFileName)
#RETURN</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/windows/tools/run-and-command-windows.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Chart Demo</title>
		<link>http://www.clarionedge.com/clarion/examples/flash-chart-demo.html</link>
		<comments>http://www.clarionedge.com/clarion/examples/flash-chart-demo.html#comments</comments>
		<pubDate>Wed, 16 Apr 2008 18:22:16 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[Examples]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/?p=21</guid>
		<description><![CDATA[
As shown at the Dutch Clarioneers meeting (22nd Nov 2007)!
Usage Notes:
As long as you make sure you have the Capesoft Object writer installed you should be able to open and compile the FlashChart.app file with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.clarionedge.com/wp-content/uploads/flashchart1.jpg"><img class="alignnone size-thumbnail wp-image-56" title="flashchart1" src="http://www.clarionedge.com/wp-content/uploads/flashchart1-109x109.jpg" alt="flashchart1" width="109" height="109" /></a></p>
<p><span class="attention">As shown at the Dutch Clarioneers meeting (22nd Nov 2007)!</span></p>
<h4>Usage Notes:</h4>
<p>As long as you make sure you have the Capesoft Object writer installed you should be able to open and compile the FlashChart.app file with no further changes. If you don&#8217;t have <a href="http://www.ingasoftplus.com/id70.htm" target="_blank">CWPlus</a> installed then you <em><strong>will </strong></em>get a template error when first opening the app but after that it will work fine regardless.</p>
<p>Templates used:</p>
<ul>
<li>Standard ABC Chain</li>
<li><em><strong>Required</strong></em> &#8211; Capesoft <a href="http://www.capesoft.com/accessories/owsp.htm" target="_blank">ObjectWriter</a> (free!)</li>
<li>Optional &#8211; Ingasoft <a href="http://www.ingasoftplus.com/id70.htm" target="_blank">CWPlus</a></li>
</ul>
<p><span class="notice">Included executable compiled with Clarion 6.3 9056</span></p>
<h4>Explanation:</h4>
<p>This example program was designed to show the possiblity of displaying Flash based web components from within a clarion application. In this example we have used the amChart component from <a href="http://www.amcharts.com/" target="_blank">http://www.amcharts.com/</a></p>
<h4>Updated:</h4>
<p>Since the meeting this demo has been updated to include an example of how to write XML datafiles and refresh the amCharts with data from a Clarion browse.</p>
<h4>Techniques used:</h4>
<ul>
<li>Integrate with Flash Charts from <a href="http://www.amcharts.com/" target="_blank">amCharts</a></li>
<li>Using the WindowComponent.</li>
<li>Runtime Creation of a <a href="http://msdn2.microsoft.com/en-us/library/aa752085.aspx" target="_blank">WebBrowser Object</a> in a Clarion window.</li>
<li>Writing classes with Capesofts <a href="http://www.capesoft.com/docs/ObjectWriter/ObjectWriter.htm" target="_blank">Object Writer</a>.</li>
<li>Using the GradientFill api function.</li>
<li>How to use the SoftVelocity supplied (cp)XML component.</li>
</ul>
<p><span class="alert">Known Issues:<br />
If I ever get motivated I will work on fixing these in upcoming version. But for now&#8230; </span></p>
<ul>
<li>v0.9.1 Clicking the &#8220;Back/Forward&#8221; buttons when first opening the &#8220;Browser&#8221; will produce an &#8220;OLE Automation Error&#8221;.</li>
</ul>
<div class="download">
<table border="0">
<tbody>
<tr>
<th>Download:</th>
<td><a rel="nofollow" title="Download version 0.1 of FlashChart_Executable.zip" href="http://www.clarionedge.com/downloads/examples/FlashChart_Executable.zip"><img src="http://www.clarionedge.com/wp-content/plugins/drain-hole/images/download.png" alt="download" width="128" height="128"/></a><br />
<a rel="nofollow" title="Download version 0.1 of FlashChart_Executable.zip" href="http://www.clarionedge.com/downloads/examples/FlashChart_Executable.zip">FlashChart_Executable.zip</a></td>
</tr>
<tr>
<th>Version:</th>
<td>0.1</td>
</tr>
<tr>
<th>Updated:</th>
<td>February 9, 2009</td>
</tr>
<tr>
<th>Size:</th>
<td>2.52 MB</td>
</tr>
<tr>
<th>Downloads:</th>
<td>158</td>
</tr>
</tbody>
</table>
</div>
<div class="download">
<table border="0">
<tbody>
<tr>
<th>Download:</th>
<td><a rel="nofollow" title="Download version 0.1 of FlashChart_Source.zip" href="http://www.clarionedge.com/downloads/examples/FlashChart_Source.zip"><img src="http://www.clarionedge.com/wp-content/plugins/drain-hole/images/download.png" alt="download" width="128" height="128"/></a><br />
<a rel="nofollow" title="Download version 0.1 of FlashChart_Source.zip" href="http://www.clarionedge.com/downloads/examples/FlashChart_Source.zip">FlashChart_Source.zip</a></td>
</tr>
<tr>
<th>Version:</th>
<td>0.1</td>
</tr>
<tr>
<th>Updated:</th>
<td>February 9, 2009</td>
</tr>
<tr>
<th>Size:</th>
<td>2.06 MB</td>
</tr>
<tr>
<th>Downloads:</th>
<td>178</td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/clarion/examples/flash-chart-demo.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BitBlt Clarion Example</title>
		<link>http://www.clarionedge.com/clarion/examples/bitblt-clarion-example.html</link>
		<comments>http://www.clarionedge.com/clarion/examples/bitblt-clarion-example.html#comments</comments>
		<pubDate>Wed, 16 Apr 2008 18:21:31 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[Examples]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/?p=19</guid>
		<description><![CDATA[This is an example of using the Windows GDI BitBlt function in a Clarion app.

As I am reminded whenever I try things like this, it is always fun and challenging playing with graphics and clarion!
Templates [...]]]></description>
			<content:encoded><![CDATA[<p>This is an example of using the Windows GDI BitBlt function in a Clarion app.</p>
<p><a href="http://www.clarionedge.com/wp-content/uploads/bitblit.jpg"><img class="alignnone size-thumbnail wp-image-59" title="bitblit" src="http://www.clarionedge.com/wp-content/uploads/bitblit-109x109.jpg" alt="bitblit" width="109" height="109" /></a></p>
<p>As I am reminded whenever I try things like this, it is always fun and <em>challenging</em> playing with graphics and clarion!</p>
<h4>Templates used:</h4>
<ul>
<li>Standard ABC Chain</li>
<li><em><strong>Required</strong></em> &#8211; Capesoft <a href="http://www.capesoft.com/accessories/owsp.htm" target="_blank">ObjectWriter</a> (free!)</li>
<li>Optional &#8211; Ingasoft <a href="http://www.ingasoftplus.com/id70.htm" target="_blank">CWPlus</a></li>
</ul>
<p><span class="notice">Included executable compiled (local) with Clarion 6.3 9056</span><br />
<span id="more-19"></span></p>
<div class="download">
<table border="0">
<tbody>
<tr>
<th>Download:</th>
<td><a rel="nofollow" title="Download version 0.1 of BitBlt.zip" href="http://www.clarionedge.com/downloads/examples/BitBlt.zip"><img src="http://www.clarionedge.com/wp-content/plugins/drain-hole/images/download.png" alt="download" width="128" height="128"/></a><br />
<a rel="nofollow" title="Download version 0.1 of BitBlt.zip" href="http://www.clarionedge.com/downloads/examples/BitBlt.zip">BitBlt.zip</a></td>
</tr>
<tr>
<th>Version:</th>
<td>0.1</td>
</tr>
<tr>
<th>Updated:</th>
<td>January 26, 2009</td>
</tr>
<tr>
<th>Size:</th>
<td>624.06 KB</td>
</tr>
<tr>
<th>Downloads:</th>
<td>170</td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/clarion/examples/bitblt-clarion-example.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
