<?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; Clarion</title>
	<atom:link href="http://www.clarionedge.com/category/clarion/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>R.I.P. faq.clarionmag.com</title>
		<link>http://www.clarionedge.com/clarion/general/r-i-p-faq-clarionmag-com.html</link>
		<comments>http://www.clarionedge.com/clarion/general/r-i-p-faq-clarionmag-com.html#comments</comments>
		<pubDate>Thu, 29 Jul 2010 21:06:28 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[Clarion]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/clarion/general/r-i-p-faq-clarionmag-com.html</guid>
		<description><![CDATA[I know it was a while ago now but I still feel the loss. Apparently the good folk at StackExchange decided there was not enough traffic. 
More info http://www.clarionmag.com/cmag/faq.html
]]></description>
			<content:encoded><![CDATA[<p>I know it was a while ago now but I still feel the loss. Apparently the good folk at <a href="http://stackexchange.com/">StackExchange</a> decided there was not enough traffic. </p>
<p>More info <a title="http://www.clarionmag.com/cmag/faq.html" href="http://www.clarionmag.com/cmag/faq.html">http://www.clarionmag.com/cmag/faq.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/clarion/general/r-i-p-faq-clarionmag-com.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clarion 6 Editor Tip &#8211; Ctrl+PgUp/PgDown</title>
		<link>http://www.clarionedge.com/clarion/general/clarion-6-editor-tip-ctrlpguppgdown.html</link>
		<comments>http://www.clarionedge.com/clarion/general/clarion-6-editor-tip-ctrlpguppgdown.html#comments</comments>
		<pubDate>Fri, 07 May 2010 11:02:07 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/clarion/general/clarion-6-editor-tip-ctrlpguppgdown.html</guid>
		<description><![CDATA[&#160;
This is something I hadn’t noticed before today. It may be common knowledge to others   
When editing an embed, if you hold down control key then PageUp and PageDown are restricted to the [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>This is something I hadn’t noticed before today. It may be common knowledge to others <img src='http://www.clarionedge.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>When editing an embed, if you hold down control key then PageUp and PageDown are restricted to the current page instead of scrolling up/down. Kind of like Home/End for the visible area only. </p>
<p>Do you know of any other obscure keyboard tricks in the Clarion editor?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/clarion/general/clarion-6-editor-tip-ctrlpguppgdown.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problems with J-Blowfish</title>
		<link>http://www.clarionedge.com/clarion/problems-with-j-blowfish.html</link>
		<comments>http://www.clarionedge.com/clarion/problems-with-j-blowfish.html#comments</comments>
		<pubDate>Thu, 22 Apr 2010 09:46:00 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[3rd Party]]></category>
		<category><![CDATA[Clarion]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/?p=326</guid>
		<description><![CDATA[From http://www.strategyonline.co.za/accessories/jblowfish/
J-Blowfish is a Clarion wrapper (pure Clarion source, no black boxes) for the Blowfish  encryption algorithm. Most of this code was written by Andy Ireland  – we have added a helper class, examples, templates, [...]]]></description>
			<content:encoded><![CDATA[<p>From <a title="http://www.strategyonline.co.za/accessories/jblowfish/" href="http://www.strategyonline.co.za/accessories/jblowfish/">http://www.strategyonline.co.za/accessories/jblowfish/</a></p>
<blockquote><p>J-Blowfish is a Clarion wrapper (pure Clarion source, no black boxes) for the Blowfish  encryption algorithm. Most of this code was written by Andy Ireland  – we have added a helper class, examples, templates, etc.</p></blockquote>
<p>I learnt a lot looking into this code a few years ago (wow, it was 2006 looking at my notes!). At the time we needed an implementation of the Blowfish Encryption Algorithm to share encrypted data between a Clarion and Java application. J-Blowfish seemed like a great fit but unfortunately we found that it was not producing standard encrypted data and was also unable to decrypt anything produced by another implementation.</p>
<p>The solution at the time was to use a C DLL instead. This worked fine but seemed a bit ugly, I would have much preferred a pure clarion solution. Also, the code in  jblowfish.clw intrigued me.</p>
<p><strong>NOTE: This is just me poking around in things to learn something new. Don’t blame me if following anything in this blog sinks your submarine or whatever <img src='http://www.clarionedge.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<h2>Here is what I found…</h2>
<p><em>(It is simpler to deal with hex output so that is the only section I have looked at but the results impact all encrypt/decrypt functions.) </em></p>
<h3>1st, Implementation problem:</h3>
<p><em>(In the &#8220;Main&#8221; procedure of BlowDemo.app) </em></p>
<p>In the demo supplied with J-Blowfish the local variable holding the key is not clipped. This means the actual key used for the Encryption is inclusive of the trailing spaces in the STRING.</p>
<p>Additionally, the blowfish <a href="http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation" target="_blank">encryption mode</a> implemented in J-Blowfish (which I believe is ECB) requires your data to be a multiple of 8 bytes. The original implementation will pad an <strong><em>extra</em></strong> 8 bytes if the data is already a multiple of 8.</p>
<p>Original:</p>

<div class="wp_syntax"><div class="code"><pre class="clarion" style="font-family:monospace;">RtnEncryptHex  <span style="color: #000080;">routine</span>
&nbsp;
  <span style="color: #008000;">! Set some properties</span>
  MyBlowfish.Key32 = loc:<span style="color: #000080;">Key</span>
  MyBlowfish.<span style="color: #000080;">Size</span> = <span style="color: #000080;">Len</span>(<span style="color: #000080;">Clip</span>(loc:<span style="color: #000080;">Text</span>)) + (8-(<span style="color: #000080;">Len</span>(<span style="color: #000080;">Clip</span>(loc:<span style="color: #000080;">Text</span>))%8))</pre></div></div>

<p>Suggested improvements:</p>

<div class="wp_syntax"><div class="code"><pre class="clarion" style="font-family:monospace;">RtnEncryptHex  <span style="color: #000080;">routine</span>
&nbsp;
  <span style="color: #008000;">! Set some properties</span>
  MyBlowfish.Key32 = <span style="color: #000080;">Clip</span>(loc:<span style="color: #000080;">Key</span>) <span style="color: #008000;">! Because loc:Key is a string not cstring without the Clip() your key is including spaces</span>
&nbsp;
  <span style="color: #000080;">IF</span> <span style="color: #000080;">Len</span>(<span style="color: #000080;">Clip</span>(loc:<span style="color: #000080;">Text</span>))%8 &gt; 0
    <span style="color: #008000;">! Pad the data to the nearest 8 character block</span>
    MyBlowfish.<span style="color: #000080;">Size</span> = <span style="color: #000080;">len</span>(<span style="color: #000080;">clip</span>(loc:<span style="color: #000080;">Text</span>)) + (8-(<span style="color: #000080;">len</span>(<span style="color: #000080;">clip</span>(loc:<span style="color: #000080;">Text</span>))%8))
  <span style="color: #000080;">ELSE</span>
    <span style="color: #008000;">! If the data length is exactly a multiple of 8 then there is no need to pad another 8.</span>
    MyBlowfish.<span style="color: #000080;">Size</span> = <span style="color: #000080;">len</span>(<span style="color: #000080;">clip</span>(loc:<span style="color: #000080;">Text</span>))
  <span style="color: #000080;">END</span></pre></div></div>

<h3>2nd, Encryption problem (jblowfish.clw)</h3>
<p>The &#8220;BlowFish._Encrypt&#8221; method seems to be the culprit in the encryption errors I experienced.</p>
<p>In my testing I was using this data:</p>
<p><strong>key:</strong> &#8220;abc&#8221;</p>
<p><strong>plain text:</strong> &#8220;abcdefgh&#8221;</p>
<p><strong>encrypted result (other tools):</strong> &#8220;94c559d64e1251fb&#8221;</p>
<p>I discovered that if in the BlowDemo.exe I used this data, &#8220;dcbahgfe&#8221; I would get the correct result (almost&#8230; the result was also backwards &#8220;d659c594 fb51124e&#8221;)</p>
<p>So it came down to a problem with the way the data was being passed to the &#8220;self.BF_Encrypt(pWork, pWork2)&#8221; part of this method.</p>
<p>(note: the BF_Encrypt method is used successfully in the BlowFish.Initialise method, I checked the values being generated and they are all correct)</p>
<p>Basically I believe this is because the <a href="http://en.wikipedia.org/wiki/Endianness" target="_blank">Endianness</a> of clarion longs is different to whatever assumption is made in the algorithm J-.Blowfish is based upon.</p>
<p>This is what I came up with:</p>

<div class="wp_syntax"><div class="code"><pre class="clarion" style="font-family:monospace;">BlowFish._Encrypt <span style="color: #000080;">procedure</span>(<span style="color: #000080;">long</span> pData, <span style="color: #000080;">long</span> dwBytes)
&nbsp;
nBlocks                 <span style="color: #000080;">long</span>,<span style="color: #000080;">auto</span>
i                       <span style="color: #000080;">long</span>,<span style="color: #000080;">auto</span>
pWork                   <span style="color: #000080;">long</span>,<span style="color: #000080;">auto</span>
pWork2                  <span style="color: #000080;">long</span>,<span style="color: #000080;">auto</span>
bchar                   &amp;byte
block                   <span style="color: #000080;">string</span>(8)
block2                  <span style="color: #000080;">string</span>(8)
&nbsp;
  <span style="color: #000080;">code</span>
    <span style="color: #000080;">if</span> dwBytes % 8
      <span style="color: #000080;">return</span> false.
&nbsp;
    nBlocks = <span style="color: #000080;">bshift</span>(dwBytes, -3)
    pWork = pData
&nbsp;
    <span style="color: #000080;">loop</span> i = 1 <span style="color: #000080;">to</span> nBlocks
      pWork2 = pWork + 4
&nbsp;
      <span style="color: #008000;">! Reverse the order of the first 4 bytes </span>
      bchar &amp;= (pWork + 3)
      block[1] = <span style="color: #000080;">Chr</span>(bchar)
      bchar &amp;= (pWork + 2)
      block[2] = <span style="color: #000080;">Chr</span>(bchar)
      bchar &amp;= (pWork + 1)
      block[3] = <span style="color: #000080;">Chr</span>(bchar)
      bchar &amp;= (pWork + 0)
      block[4] = <span style="color: #000080;">Chr</span>(bchar)
      <span style="color: #008000;">! Reverse the order of the next 4 bytes </span>
      bchar &amp;= (pWork + 7)
      block[5] = <span style="color: #000080;">Chr</span>(bchar)
      bchar &amp;= (pWork + 6)
      block[6] = <span style="color: #000080;">Chr</span>(bchar)
      bchar &amp;= (pWork + 5)
      block[7] = <span style="color: #000080;">Chr</span>(bchar)
      bchar &amp;= (pWork + 4)
      block[8] = <span style="color: #000080;">Chr</span>(bchar)
&nbsp;
      <span style="color: #008000;">!self.BF_Encrypt(pWork, pWork2) ! &lt;-- doesnt work</span>
      self.BF_Encrypt(<span style="color: #000080;">Address</span>(block), <span style="color: #000080;">Address</span>(block)+4)
&nbsp;
      <span style="color: #008000;">! Now swap them back again</span>
      block2[1] = block[4]
      block2[2] = block[3]
      block2[3] = block[2]
      block2[4] = block[1]
      block2[5] = block[8]
      block2[6] = block[7]
      block2[7] = block[6]
      block2[8] = block[5]
      <span style="color: #008000;">! And replace the data in &quot;BinData&quot; with the encrypted values</span>
      <span style="color: #000080;">Poke</span>(pWork, block2)
&nbsp;
      pWork += 8
    <span style="color: #000080;">end</span>
    <span style="color: #000080;">return</span> true</pre></div></div>

<h3>Other considerations:</h3>
<ul>
<li><strong>This only takes care of the Encryption phase something similar will need to happen in the Decrypt method.</strong></li>
<li>There may be better ways (band, bshift, bxor, whatever) to do this but it was late and this way is at least descriptive <img src='http://www.clarionedge.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
<li>I passed a few of the standard test vectors through the changed version and it seems to work correctly now. Most implementations have in them somewhere a self test method that uses these test vectors to prove they are running correctly:
<p><a href="http://www.schneier.com/blowfish.html">http://www.schneier.com/blowfish.html</a></p>
<p><a href="http://www.schneier.com/code/vectors.txt">http://www.schneier.com/code/vectors.txt</a></li>
<li>One thing I learned (amongst many!) whilst doing all this. It seems you can safely do a search replace in jpwbfish.inc and jpwbfish.clw to replace all ULONG&#8217;s with LONG&#8217;s. This may even result in some speed improvements as supposedly longs are faster then ulongs. Reason for this is that longs are 32 bit and that is sufficient for blowfish as it works in 32 bit words. It seemed weired to me at first, its like when you do this:</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="clarion" style="font-family:monospace;">SomeProcedure <span style="color: #000080;">PROCEDURE</span>()
x <span style="color: #000080;">LONG</span>
  <span style="color: #000080;">CODE</span>
&nbsp;
  x = 2147483647 <span style="color: #008000;">! The highest value a long can take</span>
  <span style="color: #000080;">Message</span>(x) <span style="color: #008000;">! It will show &quot;2147483647&quot;</span>
  x += 1
  <span style="color: #000080;">Message</span>(x) <span style="color: #008000;">! It will show &quot;-2,147,483,648&quot;</span></pre></div></div>

<p>But blowfish doesn&#8217;t care about the +/- part as it is working directly on the bytes in the long, thus a LONG is sufficient.</p>
<p>(This explanation may be off on a few technical points but you get the drift?)</p>
<p><strong><em>I hope all the above makes (some) sense! </em></strong></p>
<p>-brahn</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/clarion/problems-with-j-blowfish.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing Clarion6 IDE Fonts</title>
		<link>http://www.clarionedge.com/clarion/changing-clarion6-ide-fonts.html</link>
		<comments>http://www.clarionedge.com/clarion/changing-clarion6-ide-fonts.html#comments</comments>
		<pubDate>Sat, 12 Dec 2009 12:58:22 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[Clarion]]></category>
		<category><![CDATA[IDE]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/uncategorized/changing-clarion6-ide-fonts.html</guid>
		<description><![CDATA[The inspiration for this post came from a newsgroup message I read yesterday by JP.
Clarion IDE Fonts &#38; save your eyes ? 17/12/2005 3:44:38 PM
I found that by careful tweaking of the registry values it [...]]]></description>
			<content:encoded><![CDATA[<p>The inspiration for this post came from a newsgroup message I read yesterday by JP.</p>
<blockquote><p>Clarion IDE Fonts &amp; save your eyes ? 17/12/2005 3:44:38 PM</p></blockquote>
<p>I found that by careful tweaking of the registry values it was possible to alter the fonts used by the Clarion IDE!</p>

<div class="wp_syntax"><div class="code"><pre class="clarion" style="font-family:monospace;">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes</pre></div></div>

<p>It’s not quite as straight forward as simply specifying the fonts you want as it seems that not all fonts will be accepted. I have no idea if this is the Clarion IDE or the windows font substitutions fault but I think it is best to take what you can get at this point!</p>
<p><span class="alert"><strong>Important Note</strong>:<br />
It is required to restart Windows to allow a new or changed font substitution to take effect.</span></p>
<p>First, lets go straight to the before and after pictures:</p>
<p><a href="http://www.clarionedge.com/wp-content/uploads/image23.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Before: Booooring!" src="http://www.clarionedge.com/wp-content/uploads/image_thumb15.png" border="0" alt="Before: Booooring!" width="240" height="231" /></a> <a href="http://www.clarionedge.com/wp-content/uploads/image24.png"><img style="border: 0px none; display: inline;" title="After: Fully Customized IDE!" src="http://www.clarionedge.com/wp-content/uploads/image_thumb16.png" border="0" alt="After: Fully Customized IDE!" width="240" height="231" /></a></p>
<p>And now for a little more detail on just how this works…</p>
<p><span id="more-298"></span></p>
<p>For demonstration purposed I have used Segeo Script in all these examples. You will have to play with it and work out what suits your tastes best.</p>
<p>The After pictures employes these techniques:</p>
<ul>
<li><a href="http://technet.microsoft.com/en-us/library/cc939627.aspx" target="_blank">Font substitution</a> to change the IDE fonts</li>
<li><a href="http://www.ingasoftplus.com/id70.htm" target="_blank">CWPlus</a> with custom <a href="http://www.clarionedge.com/clarion/3rd-party/cwplus-icon-set.html" target="_blank">ClarionEdge</a> icon set!</li>
<li>Custom background specified in the C60PE.ini/C60EE.ini file. (I think the one I am using here cam from <a href="http://www.1stlogodesign.com/free_wallpapers.htm" target="_blank">1stLogoDesign</a> at some point)</li>
</ul>
<h3>There are three main registry string that we are going to play with:</h3>
<ol>
<li>MS Shell Dlg</li>
<li>Helv</li>
<li>MS Sans Serif</li>
</ol>
<p>The last one, MS Sans Serif, is a <strong><em>new registry string</em></strong> that you will have to add to make this work.</p>
<h3>Helv</h3>
<p>This one covers most of the IDE &#8211; procedure Tree, template dialogs, etc</p>
<p><a href="http://www.clarionedge.com/wp-content/uploads/image6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.clarionedge.com/wp-content/uploads/image_thumb1.png" border="0" alt="image" width="244" height="162" /></a> <a href="http://www.clarionedge.com/wp-content/uploads/image7.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.clarionedge.com/wp-content/uploads/image_thumb2.png" border="0" alt="image" width="244" height="163" /></a> <a href="http://www.clarionedge.com/wp-content/uploads/image8.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.clarionedge.com/wp-content/uploads/image_thumb3.png" border="0" alt="image" width="244" height="62" /></a></p>
<h3>New String: MS Sans Serif</h3>
<p>File picker, All the other IDE property boxes such as the Populate column toolbox and things like the main IDE Tabs.</p>
<p><a href="http://www.clarionedge.com/wp-content/uploads/image9.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.clarionedge.com/wp-content/uploads/image_thumb4.png" border="0" alt="image" width="244" height="142" /></a></p>
<p><a href="http://www.clarionedge.com/wp-content/uploads/image10.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.clarionedge.com/wp-content/uploads/image_thumb5.png" border="0" alt="image" width="244" height="113" /></a> <a href="http://www.clarionedge.com/wp-content/uploads/image11.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.clarionedge.com/wp-content/uploads/image_thumb6.png" border="0" alt="image" width="244" height="80" /></a> <a href="http://www.clarionedge.com/wp-content/uploads/image12.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.clarionedge.com/wp-content/uploads/image_thumb7.png" border="0" alt="image" width="244" height="237" /></a> <a href="http://www.clarionedge.com/wp-content/uploads/image13.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.clarionedge.com/wp-content/uploads/image_thumb8.png" border="0" alt="image" width="209" height="244" /></a></p>
<h3>Finally: MS Shell Dlg</h3>
<p>This one will change all window dialogs, you will notice it a lot more in other places than just the ClarionIDE</p>
<p>e.g.</p>
<p><a href="http://www.clarionedge.com/wp-content/uploads/image14.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.clarionedge.com/wp-content/uploads/image_thumb9.png" border="0" alt="image" width="244" height="237" /></a><a href="http://www.clarionedge.com/wp-content/uploads/image15.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.clarionedge.com/wp-content/uploads/image_thumb10.png" border="0" alt="image" width="244" height="199" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/clarion/changing-clarion6-ide-fonts.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>Translating Clarion7 Addins</title>
		<link>http://www.clarionedge.com/clarion/translating-clarion7-addins.html</link>
		<comments>http://www.clarionedge.com/clarion/translating-clarion7-addins.html#comments</comments>
		<pubDate>Mon, 01 Jun 2009 15:29:02 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[Addins]]></category>
		<category><![CDATA[Clarion]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/?p=247</guid>
		<description><![CDATA[A quick follow up to my previous article on creating a Clarion7 addin this is an example of how to provide translations of your own addins (based on the example provided I think by Lee [...]]]></description>
			<content:encoded><![CDATA[<p>A quick follow up to my previous article on <a href="http://www.clarionedge.com/clarion/clarion7-3rdparty-addinclarion7-3rdparty-addin.html" target="_blank">creating a Clarion7 addin</a> this is an example of how to provide translations of your own addins (based on the example provided I think by Lee and Charles on the newsgroups, thanks!).</p>
<p>The magic line to add to your addin file is this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;StringResources</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;Resources\StringResources.resources&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></div></div>

<p>Then for each language you intend to support you create a new resource file with the correct name e.g. StringResources.nl.resources for dutch.</p>
<p><a href="http://www.clarionedge.com/wp-content/uploads/translations.png"><img class="alignnone size-medium wp-image-250" title="translations" src="http://www.clarionedge.com/wp-content/uploads/translations-246x44.png" alt="translations" width="246" height="44" /></a></p>
<p>In the download you will find the C# project files as well as the addin itself. Also included is a BitmapResources.resources file containing all the Silk icons from <a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">famfamfam</a> which I thought were pretty neat to use as menu icons <img src='http://www.clarionedge.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="download">
<table border="0">
<tbody>
<tr>
<th>Download:</th>
<td><a rel="nofollow" title="Download version 0.1 of AccessoryMenu.sdaddin" href="http://www.clarionedge.com/downloads/3rdParty/AccessoryMenu.sdaddin"><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 AccessoryMenu.sdaddin" href="http://www.clarionedge.com/downloads/3rdParty/AccessoryMenu.sdaddin">AccessoryMenu.sdaddin</a></td>
</tr>
<tr>
<th>Version:</th>
<td>0.1</td>
</tr>
<tr>
<th>Updated:</th>
<td>June 2, 2009</td>
</tr>
<tr>
<th>Size:</th>
<td>618.58 KB</td>
</tr>
<tr>
<th>Downloads:</th>
<td>122</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 AccessoryMenu.zip" href="http://www.clarionedge.com/downloads/3rdParty/AccessoryMenu.zip"><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 AccessoryMenu.zip" href="http://www.clarionedge.com/downloads/3rdParty/AccessoryMenu.zip">AccessoryMenu.zip</a></td>
</tr>
<tr>
<th>Version:</th>
<td>0.1</td>
</tr>
<tr>
<th>Updated:</th>
<td>June 2, 2009</td>
</tr>
<tr>
<th>Size:</th>
<td>1.82 MB</td>
</tr>
<tr>
<th>Downloads:</th>
<td>107</td>
</tr>
</tbody>
</table>
</div>
<p>This is the addin file in case you want a quick look:</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
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;AddIn</span> name        = <span style="color: #ff0000;">&quot;AccessoryMenu&quot;</span></span>
<span style="color: #009900;">       author      = <span style="color: #ff0000;">&quot;&quot;</span></span>
<span style="color: #009900;">       url         = <span style="color: #ff0000;">&quot;&quot;</span></span>
<span style="color: #009900;">       description = <span style="color: #ff0000;">&quot;Common menu for all addin writers!&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Identity</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;AccessoryMenu.Addin&quot;</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;0.3&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Dependency</span> addin = <span style="color: #ff0000;">&quot;SharpDevelop&quot;</span> version = <span style="color: #ff0000;">&quot;2.1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;BitmapResources</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;Resources\BitmapResources.resources&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;StringResources</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;Resources\StringResources.resources&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Path</span> name = <span style="color: #ff0000;">&quot;/SharpDevelop/Workbench/MainMenu/Help&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;MenuItem</span> id = <span style="color: #ff0000;">&quot;Accessory&quot;</span> </span>
<span style="color: #009900;">		          label = <span style="color: #ff0000;">&quot;${res:Addin.Menu.Accessory}&quot;</span> </span>
<span style="color: #009900;">		          type =<span style="color: #ff0000;">&quot;Menu&quot;</span> </span>
<span style="color: #009900;">		          insertbefore = <span style="color: #ff0000;">&quot;SDKHelp&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;MenuItem</span> id = <span style="color: #ff0000;">&quot;About&quot;</span></span>
<span style="color: #009900;">					  label = <span style="color: #ff0000;">&quot;${res:Addin.Menu.About}&quot;</span></span>
<span style="color: #009900;">					  icon = <span style="color: #ff0000;">&quot;Icons.Silk.plugin&quot;</span></span>
<span style="color: #009900;">					  link = <span style="color: #ff0000;">&quot;http://www.c3pa.com/&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/MenuItem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/AddIn<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/clarion/translating-clarion7-addins.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clarion7 3rdParty Addin!</title>
		<link>http://www.clarionedge.com/clarion/clarion7-3rdparty-addin.html</link>
		<comments>http://www.clarionedge.com/clarion/clarion7-3rdparty-addin.html#comments</comments>
		<pubDate>Wed, 20 May 2009 12:30:47 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[3rd Party]]></category>
		<category><![CDATA[Clarion]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/?p=236</guid>
		<description><![CDATA[This is a very simple example of using the new Clarion7 IDE addin system to put a new item into the help menu.

Download the addin file &#8211; Clarion3rdParty.sdaddin
Start the Clarion 7 IDE:

Go to the Tools [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very simple example of using the new Clarion7 IDE addin system to put a new item into the help menu.</p>
<ol>
<li>Download the addin file &#8211; <a rel="nofollow" title="Download version 0.1 of Clarion3rdParty.sdaddin" href="http://www.clarionedge.com/downloads/3rdParty/Clarion3rdParty.sdaddin">Clarion3rdParty.sdaddin</a></li>
<li>Start the Clarion 7 IDE:<br />
<a href="http://www.clarionedge.com/wp-content/uploads/startide.png"><img class="alignnone size-medium wp-image-237" title="Start IDE" src="http://www.clarionedge.com/wp-content/uploads/startide-246x184.png" alt="Start IDE" width="246" height="184" /></a></li>
<li>Go to the Tools menu and select the Addin Manager:<br />
<a href="http://www.clarionedge.com/wp-content/uploads/addinmanager.png"><img class="alignnone size-medium wp-image-238" title="addinmanager" src="http://www.clarionedge.com/wp-content/uploads/addinmanager-246x173.png" alt="addinmanager" width="246" height="173" /></a></li>
<li>Click the Install Addin button:<br />
<a href="http://www.clarionedge.com/wp-content/uploads/installaddin.png"><img class="alignnone size-medium wp-image-239" title="installaddin" src="http://www.clarionedge.com/wp-content/uploads/installaddin-246x218.png" alt="installaddin" width="246" height="218" /></a></li>
<li>Find the Addin file you downloaded in Step 1<br />
<a href="http://www.clarionedge.com/wp-content/uploads/findaddinfile.png"><img class="alignnone size-medium wp-image-240" title="findaddinfile" src="http://www.clarionedge.com/wp-content/uploads/findaddinfile-246x186.png" alt="findaddinfile" width="246" height="186" /></a></li>
<li>You should now see the new addin listed in the Addin Manager, restart the IDE to see what it does!<br />
<a href="http://www.clarionedge.com/wp-content/uploads/restartide.png"><img class="alignnone size-medium wp-image-241" title="restartide" src="http://www.clarionedge.com/wp-content/uploads/restartide-246x218.png" alt="restartide" width="246" height="218" /></a></li>
<li>And there you have it, a new menu item under Help&#8211;&gt;Web !<br />
<a href="http://www.clarionedge.com/wp-content/uploads/success.png"><img class="alignnone size-medium wp-image-242" title="success" src="http://www.clarionedge.com/wp-content/uploads/success-246x50.png" alt="success" width="246" height="50" /></a></li>
</ol>
<p>Simply adding a menu item is very easy with the new Clarion 7 IDE. I suppose the hardest part is finding the correct names for everything and getting them in the right place. The Clarion3rdParty.sdaddin file you downloaded at the beginning is just a zip file containing one XML formatted &#8220;addin&#8221; file. This XML simply tells the IDE what you want to do and where to do it.</p>
<p>This is the XML used in the Clarion3rdParty addin:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;AddIn</span> name    = <span style="color: #ff0000;">&quot;Clarion3rdPartyAddin&quot;</span></span>
<span style="color: #009900;">   author      = <span style="color: #ff0000;">&quot;Brahn Partridge&quot;</span></span>
<span style="color: #009900;">   url         = <span style="color: #ff0000;">&quot;&quot;</span></span>
<span style="color: #009900;">   copyright   = <span style="color: #ff0000;">&quot;&quot;</span></span>
<span style="color: #009900;">   description = <span style="color: #ff0000;">&quot;TODO: Put description here&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Identity</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ClarionEdge.Clarion3rdPartyAddin&quot;</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;0.1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Dependency</span> addin = <span style="color: #ff0000;">&quot;SharpDevelop&quot;</span> version = <span style="color: #ff0000;">&quot;2.1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Path</span> name = <span style="color: #ff0000;">&quot;/SharpDevelop/Workbench/MainMenu/Help/Web&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;MenuItem</span> id = <span style="color: #ff0000;">&quot;Clarion3rdParty&quot;</span> label = <span style="color: #ff0000;">&quot;Clarion 3rd Party&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Menu&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;MenuItem</span> id = <span style="color: #ff0000;">&quot;ClarionEdge&quot;</span></span>
<span style="color: #009900;">					  label = <span style="color: #ff0000;">&quot;www.clarionedge.com&quot;</span></span>
<span style="color: #009900;">					  icon = <span style="color: #ff0000;">&quot;Icons.16x16.WebSearchIcon&quot;</span></span>
<span style="color: #009900;">					  link = <span style="color: #ff0000;">&quot;http://www.clarionedge.com/&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/MenuItem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/AddIn<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>And the download again in case you missed it:</p>
<div class="download">
<table border="0">
<tbody>
<tr>
<th>Download:</th>
<td><a rel="nofollow" title="Download version 0.1 of Clarion3rdParty.sdaddin" href="http://www.clarionedge.com/downloads/3rdParty/Clarion3rdParty.sdaddin"><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 Clarion3rdParty.sdaddin" href="http://www.clarionedge.com/downloads/3rdParty/Clarion3rdParty.sdaddin">Clarion3rdParty.sdaddin</a></td>
</tr>
<tr>
<th>Version:</th>
<td>0.1</td>
</tr>
<tr>
<th>Updated:</th>
<td>May 20, 2009</td>
</tr>
<tr>
<th>Size:</th>
<td>471 bytes</td>
</tr>
<tr>
<th>Downloads:</th>
<td>197</td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/clarion/clarion7-3rdparty-addin.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>APPCRASH fun with WslDebug$NameMessage</title>
		<link>http://www.clarionedge.com/clarion/general/appcrash-fun-with-wsldebugnamemessage.html</link>
		<comments>http://www.clarionedge.com/clarion/general/appcrash-fun-with-wsldebugnamemessage.html#comments</comments>
		<pubDate>Sat, 25 Apr 2009 13:19:02 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/?p=228</guid>
		<description><![CDATA[At work the other day we had a report from a client that the latest version of our software was not working on new Vista machines. Ingeniously, the customer managed to discover that if they [...]]]></description>
			<content:encoded><![CDATA[<p>At work the other day we had a report from a client that the latest version of our software was not working on new Vista machines. Ingeniously, the customer managed to discover that if they initially launched the program with elevated (administrator) access then subsequent executions of  the program would work un-elevated.</p>
<p>Just yestarday I managed to duplicate these symptoms in my development environment and discovered that the problem was being triggered in the InitSetEventOffset ROUTINE of the Debuger class we are using.</p>
<p>You can download the class over at Radfusion <a href="http://www.radfusion.com/PDFgallery.htm" target="_blank">Free Downloads</a>.</p>
<p>The helpful folk over at the <a href="http://www.skype.com/go/joinpublicchat?chat&amp;skypename=msarson&amp;topic=CW-Talk+2&amp;blob=r8AnVvWRDpLksKm_V4l2uDqrht9EI8omKxWpHOiLNI9fyhx5IRDg7B8lK7EcgmFbDGj7_U_S72A6dIVQp_evDjjFvjW75-OEst5zTiRAn3vucAazmaE2rV8P0Zw6A167h6Vhn4T2T_s8cnZ6Z3WdG4apN9O6t0-R" target="_blank">clarion skype chat</a> were able to narrow this down to a problem with the length of the CSTRING used in the call to DebugerNameMessage.</p>
<p>Further analysis shows that this only manifests as an issue under very specific circumstances:</p>
<ul>
<li>The class instance is created using New().</li>
<li>The application is compiled with debug mode set to &#8220;off&#8221; (or in other words, in &#8220;release&#8221; mode).</li>
<li>The application is run &#8220;asInvoker&#8221; on a system with UAC tuned ON.</li>
<li>There is no &#8220;EventOffset&#8221; entry already in the WIN.INI file*.</li>
</ul>
<p><sub>* That last point will depend on the version of the debuger class you are using. The one we have here is &#8220;6.0.2&#8243; but there are others around that no longer use WIN.INI and they might work OK. Note though that when I say &#8220;OK&#8221; the problem hasn&#8217;t gone away and you will still see the APPCRASH error the first time your program is run but subsequent executions will be able to read the offset from the INI file and this bypasses this bug.</sub></p>
<p>Changing the variable from CSTRING(20) to CSTRING(128) fixed the problem (Thanks Larry!) but I was still curious to find out what the cause was.</p>
<p>First lets look at the prototype forDebugerNameMessage :</p>

<div class="wp_syntax"><div class="code"><pre class="clarion" style="font-family:monospace;"><span style="color: #000080;">MODULE</span>(<span style="color: #008000;">'C%V%RUN%X%')
</span>  DebugerNameMessage(*<span style="color: #000080;">CSTRING</span>, <span style="color: #000080;">UNSIGNED</span> EventNum ),<span style="color: #000080;">NAME</span>(<span style="color: #008000;">'WslDebug$NameMessage'),RAW   !Note: use   EVENT() + EVENT:FIRST else will get WM_*
</span><span style="color: #000080;">END</span></pre></div></div>

<p>And it&#8217;s usage:</p>

<div class="wp_syntax"><div class="code"><pre class="clarion" style="font-family:monospace;">Debuger.GetEventDescr             <span style="color: #000080;">PROCEDURE</span>(<span style="color: #000080;">LONG</span> ArgEvent)
LOC:Retval   <span style="color: #000080;">CSTRING</span>(20)
LOC:EventNum <span style="color: #000080;">UNSIGNED</span>
  <span style="color: #000080;">CODE</span>
  DebugerNameMessage(LOC:Retval, LOC:EventNum)</pre></div></div>

<p>(I have removed all the other code from the above method just for clarity in this example)</p>
<p>The call to DebugerNameMessage crashed just after giving this result:</p>

<div class="wp_syntax"><div class="code"><pre class="clarion" style="font-family:monospace;">LOC:Retval=WM_OTHERWINDOWCREATE, LOC:EventNum=66</pre></div></div>

<p>When the LOC:RetVal is changed to CSTRING(128) we see that the next call is this:</p>

<div class="wp_syntax"><div class="code"><pre class="clarion" style="font-family:monospace;">LOC:Retval=WM_OTHERWINDOWDESTROY, LOC:EventNum=67</pre></div></div>

<p>The reason for the crash I guess is Len(WM_OTHERWINDOWDESTROY) &gt; 20</p>
<p>There are 2 questions remaining and I think I have the answer for one:</p>
<h4>Why does it only crash when the class is instantiated with New()?</h4>
<p>I am pretty sure this simply because when using New() the &#8220;EventOffset&#8221; is different and so the InitSetEventOffset routine attempts to find the correct offset and thus triggering the problem with our too small variable.</p>
<h4>Why does it only happen when the program is compile with debugging turned OFF?</h4>
<p>I guess in debug mode the code it is not so sensitive about the buffer overrun it still seems kind of strange that it should work at all.</p>
<p>Hopefully someone reading this will be able to give a hint as to a possible reason?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/clarion/general/appcrash-fun-with-wsldebugnamemessage.html/feed</wfw:commentRss>
		<slash:comments>0</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>Trailing spaces in strings &#8211; Clarion vs SQL</title>
		<link>http://www.clarionedge.com/clarion/trailing-spaces-in-strings-clarion-vs-sql.html</link>
		<comments>http://www.clarionedge.com/clarion/trailing-spaces-in-strings-clarion-vs-sql.html#comments</comments>
		<pubDate>Thu, 19 Feb 2009 16:54:22 +0000</pubDate>
		<dc:creator>brahn</dc:creator>
				<category><![CDATA[Clarion]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.clarionedge.com/?p=209</guid>
		<description><![CDATA[This topic came up at work a while ago when trying to perform database operations on strings containing a trailing space.
The Problem: One of our stored procedures was using CHARINDEX to search for strings within [...]]]></description>
			<content:encoded><![CDATA[<p>This topic came up at work a while ago when trying to perform database operations on strings containing a trailing space.</p>
<p>The Problem: One of our stored procedures was using CHARINDEX to search for strings within the database. The problem appeared when a user defined a search parameter containing a trailing space and the results of the search were not as expected.</p>
<h2>SQL and Trailing Blanks</h2>
<p>(From the section &#8220;Comparison operators, listed&#8221; in SQL help)</p>
<p>Trailing blanks are ignored in comparisons; for example, these are equivalent:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">WHERE</span> LastName <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'White'</span>
<span style="color: #993333; font-weight: bold;">WHERE</span> LastName <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'White '</span>
<span style="color: #993333; font-weight: bold;">WHERE</span> LastName <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'White'</span> <span style="color: #66cc66;">+</span> SPACE<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>This is an interesting article: <a href="http://support.microsoft.com/kb/316626">INF: How SQL Server Compares Strings with Trailing Spaces</a></p>
<p>Sort of related but actually about how data is stored is the ANSI_PADDING setting:</p>
<p><a href="http://technet.microsoft.com/en-us/library/ms187403.aspx">http://technet.microsoft.com/en-us/library/ms187403.aspx</a></p>
<h2>Display Trailing Space in Clarion</h2>
<p>The Clarion entry control and text control don&#8217;t appear to be able to show trailing spaces from data in a database. You can enter trailing spaces in an entry or text control and save the data but next time you view or edit the form those trailing spaces are not shown.</p>
<p>Funnily enough, if the data <em>does </em>have trailing spaces and the field is not edited then the trailing spaces remain intact when the form is saved.</p>
<h2>Fun with SELECT Statements</h2>
<p>Have a play with the following SQL to see some examples:</p>
<p><em>Note the use of &#8220;LIKE&#8221; rather than &#8220;=&#8221; and the &#8220;[^ ]&#8221; will force the WHERE to only match items without the trailing space.<br />
</em><em>Also, try setting the ANSI_PADDING to &#8220;OFF&#8221; and see the difference in the results.</em></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> ANSI_PADDING <span style="color: #993333; font-weight: bold;">ON</span>;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> t1 <span style="color: #66cc66;">&#40;</span>charcol CHAR<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">16</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> varcharcol VARCHAR<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">16</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> t1 <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'No blanks'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'No blanks'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> t1 <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Trailing blank '</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Trailing blank '</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> t1 <span style="color: #993333; font-weight: bold;">WHERE</span> varcharcol <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'No blanks     '</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> t1 <span style="color: #993333; font-weight: bold;">WHERE</span> charcol <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'No blanks     '</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> t1 <span style="color: #993333; font-weight: bold;">WHERE</span> varcharcol <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'Trailing blank[^ ]'</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> t1 <span style="color: #993333; font-weight: bold;">WHERE</span> charcol <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'Trailing blank[^ ]'</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">DROP</span> <span style="color: #993333; font-weight: bold;">TABLE</span> t1</pre></div></div>

<p>So there are a few thoughts and discoveries that came up in the course of investigating this issue. Of course once you know the reasons there are ways to workaround the problems but I will leave that up to your individual scenario&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clarionedge.com/clarion/trailing-spaces-in-strings-clarion-vs-sql.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
