<?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>SAPIEN Technologies &#187; Howto</title>
	<atom:link href="http://blog.sapien.com/index.php/topics/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sapien.com</link>
	<description>Tools for IT Success</description>
	<lastBuildDate>Wed, 28 Jul 2010 20:03:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Moving to 64 bit: Running VBScript files in 64 bit mode from PrimalScript 2009</title>
		<link>http://blog.sapien.com/index.php/2010/07/28/moving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009/</link>
		<comments>http://blog.sapien.com/index.php/2010/07/28/moving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 20:03:22 +0000</pubDate>
		<dc:creator>Alex Riedel</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[PrimalScript]]></category>
		<category><![CDATA[Software News]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[JScript]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Server 2008]]></category>
		<category><![CDATA[Sysnative]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://blog.sapien.com/index.php/2010/07/28/moving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009/</guid>
		<description><![CDATA[PrimalScript 2009 usually uses CScript.exe to run VBScript files and captures its output and directs it to the IDE&#8217;s output windows.
Since PrimalScript 2009 is a 32 bit application the host used is also of the 32 bit variety, residing in the System32 folder of your Windows directory.
If you are working on a 64 bit operating [...]]]></description>
			<content:encoded><![CDATA[<p>PrimalScript 2009 usually uses CScript.exe to run VBScript files and captures its output and directs it to the IDE&#8217;s output windows.</p>
<p>Since PrimalScript 2009 is a 32 bit application the host used is also of the 32 bit variety, residing in the System32 folder of your Windows directory.</p>
<p>If you are working on a 64 bit operating system and you have to use 64 bit COM objects you need to be able to run your scripts in 64 bit mode.</p>
<p>In order to do that you can simply change what specific version of CScript.exe is used by specifying the full path:</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2010/07/VBScript64-1.png" target="_blank"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="484" alt="VBScript64-1" src="http://blog.sapien.com/wp-content/uploads/2010/07/VBScript64-1_thumb.png" width="615" border="0"></a> </p>
<p>Go to Tools &#8211; Options &#8211; Environment &#8211; Languages and select VBScript. The default entry for the script engine just states &#8220;CScript.exe&#8221;. If you change that to C:\Windows\Sysnative\cscript.exe you get PrimalScipt to execute the 64 bit version. The &#8220;sysnative&#8221; substitute for system32 works on Vista, Windows 7 and Server 2008 operating system flavors.</p>
<p>If you don&#8217;t want to change the default behavior and just occasionally execute scripts in 64 bit mode, you can just leave the above mentioned setting alone and add the 64 bit engine to your Tools browser:</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2010/07/VBScript64-2.png" target="_blank"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="243" alt="VBScript64-2" src="http://blog.sapien.com/wp-content/uploads/2010/07/VBScript64-2_thumb.png" width="644" border="0"></a> </p>
<p>Right click anywhere in the tools browser and select &#8220;Customize&#8230;&#8221; and add a new tool in a group of your choice and add the settings as shown above. In order to run the current script in 64 bit mode you only have to click on the icon.</p>
<p>All these things work just as well for JScript if that is your language of choice, but don&#8217;t try this for PowerShell. PowerShell does not like to get its input and output streams redirected and will just hang if you try to do that. We will talk about 64 bit PowerShell in the next installment.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F28%2Fmoving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+VBScript+files+in+64+bit+mode+from+PrimalScript+2009" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F28%2Fmoving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+VBScript+files+in+64+bit+mode+from+PrimalScript+2009" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F28%2Fmoving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+VBScript+files+in+64+bit+mode+from+PrimalScript+2009" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F28%2Fmoving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+VBScript+files+in+64+bit+mode+from+PrimalScript+2009" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F28%2Fmoving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+VBScript+files+in+64+bit+mode+from+PrimalScript+2009', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F28%2Fmoving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F28%2Fmoving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F28%2Fmoving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+VBScript+files+in+64+bit+mode+from+PrimalScript+2009" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F28%2Fmoving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+VBScript+files+in+64+bit+mode+from+PrimalScript+2009" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/64bit' rel='tag' target='_self'>64bit</a>, <a class='technorati-link' href='http://technorati.com/tag/JScript' rel='tag' target='_self'>JScript</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalScript' rel='tag' target='_self'>PrimalScript</a>, <a class='technorati-link' href='http://technorati.com/tag/Server+2008' rel='tag' target='_self'>Server 2008</a>, <a class='technorati-link' href='http://technorati.com/tag/Sysnative' rel='tag' target='_self'>Sysnative</a>, <a class='technorati-link' href='http://technorati.com/tag/VBScript' rel='tag' target='_self'>VBScript</a>, <a class='technorati-link' href='http://technorati.com/tag/Vista' rel='tag' target='_self'>Vista</a>, <a class='technorati-link' href='http://technorati.com/tag/windows+7' rel='tag' target='_self'>windows 7</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.sapien.com/index.php/2010/07/28/moving-to-64-bit-running-vbscript-files-in-64-bit-mode-from-primalscript-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving to 64 bit: Running a 64 bit PowerShell console inside PrimalScript 2009</title>
		<link>http://blog.sapien.com/index.php/2010/07/20/moving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009/</link>
		<comments>http://blog.sapien.com/index.php/2010/07/20/moving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 08:59:51 +0000</pubDate>
		<dc:creator>Alex Riedel</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[PrimalScript]]></category>
		<category><![CDATA[Software News]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[32 bit]]></category>
		<category><![CDATA[64 bit]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[SAPIEN]]></category>
		<category><![CDATA[Server 2008]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://blog.sapien.com/index.php/2010/07/20/moving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009/</guid>
		<description><![CDATA[PrimalScript 2009 is a 32 bit application, so by default it uses the 32 bit version of PowerShell even on a 64 bit machine for the embedded console.
If you are dealing with mostly 64 bit server software you may want to make the embedded shell use the 64 bit version of PowerShell. The default installation [...]]]></description>
			<content:encoded><![CDATA[<p>PrimalScript 2009 is a 32 bit application, so by default it uses the 32 bit version of PowerShell even on a 64 bit machine for the embedded console.</p>
<p>If you are dealing with mostly 64 bit server software you may want to make the embedded shell use the 64 bit version of PowerShell. The default installation of PowerShell under Windows 7 is at C:\Windows\System32\WindowsPowerShell\v1.0</p>
<p>And yes, that is still true for PowerShell V2.</p>
<p>The system32 folder is mapped to SysWOW64, which is the actual 32 bit version of the that folder. I know, the numbering scheme is a bit confusing. </p>
<p>Fortunately with Vista 64bit, Server 2008 64 bit and Windows 7 64 bit there is a path specification that explicitly points to the 64 bit folder. </p>
<p>Open PrimalScript 2009 and select Tools &#8211; Options &#8211; Environment &#8211; Command Window.</p>
<p>Select &#8220;Other Process&#8221; and enter the following path:<br />C:\Windows\Sysnative\WindowsPowerShell\v1.0\PowerShell.exe</p>
<p>&nbsp;</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2010/07/PowerShell64.png" target="_blank"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="243" alt="PowerShell64" src="http://blog.sapien.com/wp-content/uploads/2010/07/PowerShell64_thumb.png" width="644" border="0"></a> </p>
<p>Press OK and use View &#8211; Other Windows &#8211; Command Window to bring up the embedded shell if you don&#8217;t have it active yet.</p>
<p>You can now actually right click and toggle between the 32 and the 64 bit shell using either &#8220;Windows PowerShell&#8221; or PowerShell.exe</p>
<p>Drag and drop you scripts, partial code or snippets onto the embedded shell to run things.</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2010/07/64bitShell.png" target="_blank"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="393" alt="64bitShell" src="http://blog.sapien.com/wp-content/uploads/2010/07/64bitShell_thumb.png" width="644" border="0"></a> </p>
<p>How can you tell the difference? While there is no obvious variable that screams 64 or 32 bit, I found the following a good indicator:</p>
<p>Type ls env:programfiles</p>
<p>If it has a value of &#8220;C:\Program Files&#8221; you are in a 64 bit shell, if it says &#8220;C:\Program Files (x86)&#8221; you have a 32 bit PowerShell instance running.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F20%2Fmoving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+a+64+bit+PowerShell+console+inside+PrimalScript+2009" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F20%2Fmoving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+a+64+bit+PowerShell+console+inside+PrimalScript+2009" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F20%2Fmoving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+a+64+bit+PowerShell+console+inside+PrimalScript+2009" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F20%2Fmoving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+a+64+bit+PowerShell+console+inside+PrimalScript+2009" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F20%2Fmoving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+a+64+bit+PowerShell+console+inside+PrimalScript+2009', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F20%2Fmoving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F20%2Fmoving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F20%2Fmoving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+a+64+bit+PowerShell+console+inside+PrimalScript+2009" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F07%2F20%2Fmoving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009%2F&amp;title=Moving+to+64+bit%3A+Running+a+64+bit+PowerShell+console+inside+PrimalScript+2009" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/32+bit' rel='tag' target='_self'>32 bit</a>, <a class='technorati-link' href='http://technorati.com/tag/64+bit' rel='tag' target='_self'>64 bit</a>, <a class='technorati-link' href='http://technorati.com/tag/console' rel='tag' target='_self'>console</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalScript' rel='tag' target='_self'>PrimalScript</a>, <a class='technorati-link' href='http://technorati.com/tag/SAPIEN' rel='tag' target='_self'>SAPIEN</a>, <a class='technorati-link' href='http://technorati.com/tag/Server+2008' rel='tag' target='_self'>Server 2008</a>, <a class='technorati-link' href='http://technorati.com/tag/Vista' rel='tag' target='_self'>Vista</a>, <a class='technorati-link' href='http://technorati.com/tag/windows+7' rel='tag' target='_self'>windows 7</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.sapien.com/index.php/2010/07/20/moving-to-64-bit-running-a-64-bit-powershell-console-inside-primalscript-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simpler eBook Downloads</title>
		<link>http://blog.sapien.com/index.php/2010/03/01/simpler-ebook-downloads/</link>
		<comments>http://blog.sapien.com/index.php/2010/03/01/simpler-ebook-downloads/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 22:13:10 +0000</pubDate>
		<dc:creator>Ferdinand Rios</dc:creator>
				<category><![CDATA[Books and Training]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[tfm]]></category>

		<guid isPermaLink="false">http://blog.sapien.com/?p=2094</guid>
		<description><![CDATA[SAPIEN Technologies has streamlined it&#8217;s ebook download scheme for an easier user experience. Customers that purchase SAPIEN Press ebooks on ScriptingOutpost.com only need to register their license keys on My.SAPIEN.com to instantly download their ebooks. Once registered, a download link appears next to the ebook title. The customer just clicks that link to download their [...]]]></description>
			<content:encoded><![CDATA[<p>SAPIEN Technologies has streamlined it&#8217;s ebook download scheme for an easier user experience. Customers that purchase SAPIEN Press ebooks on ScriptingOutpost.com only need to register their license keys on My.SAPIEN.com to instantly download their ebooks. Once registered, a download link appears next to the ebook title. The customer just clicks that link to download their title.</p>
<p>This new process eliminates the middle step of waiting for an email with a download link and therefore eliminating the problem of lost emails or emails getting trapped in spam filters.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F03%2F01%2Fsimpler-ebook-downloads%2F&amp;title=Simpler+eBook+Downloads" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F03%2F01%2Fsimpler-ebook-downloads%2F&amp;title=Simpler+eBook+Downloads" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F03%2F01%2Fsimpler-ebook-downloads%2F&amp;title=Simpler+eBook+Downloads" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F03%2F01%2Fsimpler-ebook-downloads%2F&amp;title=Simpler+eBook+Downloads" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F03%2F01%2Fsimpler-ebook-downloads%2F&amp;title=Simpler+eBook+Downloads', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F03%2F01%2Fsimpler-ebook-downloads%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F03%2F01%2Fsimpler-ebook-downloads%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F03%2F01%2Fsimpler-ebook-downloads%2F&amp;title=Simpler+eBook+Downloads" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F03%2F01%2Fsimpler-ebook-downloads%2F&amp;title=Simpler+eBook+Downloads" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Books' rel='tag' target='_self'>Books</a>, <a class='technorati-link' href='http://technorati.com/tag/tfm' rel='tag' target='_self'>tfm</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.sapien.com/index.php/2010/03/01/simpler-ebook-downloads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PrimalForms 2009: The Packager and Command line Arguments</title>
		<link>http://blog.sapien.com/index.php/2010/02/09/primalforms-2009-the-packager-and-command-line-arguments/</link>
		<comments>http://blog.sapien.com/index.php/2010/02/09/primalforms-2009-the-packager-and-command-line-arguments/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 17:20:14 +0000</pubDate>
		<dc:creator>David Corrales</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[PrimalForms]]></category>
		<category><![CDATA[PrimalScript]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[Packager]]></category>
		<category><![CDATA[PrimalScript 2009]]></category>

		<guid isPermaLink="false">http://blog.sapien.com/?p=2061</guid>
		<description><![CDATA[Per forum request, this blog provides examples of how to access the packager’s command line arguments as well as provide some useful functions to parse the contents. These examples apply to PrimalForms 2009’s Packager and as well as PrimalScript 2009’s packager.
The package’s script host provides a convenient string variable named $CommandLine. This variable contains the [...]]]></description>
			<content:encoded><![CDATA[<p>Per forum request, this blog provides examples of how to access the packager’s command line arguments as well as provide some useful functions to parse the contents. These examples apply to PrimalForms 2009’s Packager and as well as PrimalScript 2009’s packager.</p>
<p>The package’s script host provides a convenient string variable named $CommandLine. This variable contains the complete argument string that is passed to the package. To illustrate how the $CommandLine variable is used, a script package named “mypackage.exe” will be executed&#160; with the following arguments:</p>
<p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450"><font size="1">
<p>mypackage.exe –Parameter1 Value1 –Parameter2 Value2</p>
<p>           </font></td>
</tr>
</tbody>
</table>
<p>The resulting string value of $CommandLine is as follows:</p>
<p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450">
<p><font size="1">$CommandLine: “–Parameter1” “Value1” “–Parameter2” “Value2”</font></p>
</td>
</tr>
</tbody>
</table>
<p>As you can see all the parameter / values are in a single line and each surrounded by quotes. </p>
<p><strong>Accessing the Argument Parameters</strong></p>
<p>The simplest example of command line argument use is when a parameter is passed and there is no associated value. In order to determine if the argument is present, a simple search of the string will suffice. </p>
<p>For example:</p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450">
<p><font size="1">mypackage.exe /? /a</font></p>
</td>
</tr>
</tbody>
</table>
<p>In this example we only care that “/?” is present; therefore, we only need to search the $CommandLine string for “/?” parameter.</p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450">
<p><font size="1">$CommandLine: “/?” “/a”</font></p>
</td>
</tr>
</tbody>
</table>
<p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450"><font size="1">if($CommandLine.Contains(&quot;&quot;&quot;/?&quot;&quot;&quot;))              <br />{               <br />&#160;&#160;&#160; Write-Host &quot;Found Parameter&quot;               <br />}               <br /></font></td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<p>In other instances a value pair may be needed. The first example above illustrates the value pair.</p>
<p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450">
<p><font size="1">mypackage.exe –Parameter1 Value1 –Parameter2 Value2</font></p>
</td>
</tr>
</tbody>
</table>
<p>In this case, the information will need to be parsed from the command line string which requires a more complex approach then a simple search. To help facilitate this, a function called <strong>Parse-Commandline</strong> was created which will parse the $CommandLine string values from the quotes and place them into a StringCollection.</p>
</p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450">
<p><font size="1">function Parse-Commandline              <br />{               <br />&#160;&#160;&#160; Param([string]$CommandLine)               <br />&#160;&#160;&#160; $Arguments = New-Object System.Collections.Specialized.StringCollection               <br />&#160;&#160;&#160; #Find First Quote               <br />&#160;&#160;&#160; $index = $CommandLine.IndexOf(&#8216;&quot;&#8217;) </font></p>
<p><font size="1">&#160;&#160;&#160; while ( $index -ne -1)              <br />&#160;&#160;&#160; {#Continue as along as we find a quote               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; #Find Closing Quote               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $closeIndex = $CommandLine.IndexOf(&#8216;&quot;&#8217;,$index + 1)               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if($closeIndex -eq -1)               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break #Can&#8217;t find a match               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $value = $CommandLine.Substring($index + 1,$closeIndex &#8211; ($index + 1))               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; [void]$Arguments.Add($value)               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $index = $closeIndex </font></p>
<p><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; #Find First Quote              <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $index = $CommandLine.IndexOf(&#8216;&quot;&#8217;,$index + 1)               <br />&#160;&#160;&#160; }               <br />&#160;&#160;&#160; return $Arguments               <br />}</font></p>
</td>
</tr>
</tbody>
</table>
<p>Using the following command line will yield these results: </p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450">
<p><font size="1">$CommandLine: “–Parameter1” “Value1” “–Parameter2” “Value2”</font> </p>
</td>
</tr>
</tbody>
</table>
<p>Results:</p>
<p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450">
<p><font size="1">$Parameter[0] = –Parameter</font></p>
<p><font size="1">$Parameter[1] = Value1</font></p>
<p><font size="1">$Parameter[2] = –Parameter2</font></p>
<p><font size="1">$Parameter[3] = Value2</font></p>
</td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<p>The parameters can be compared by simply checking each element of the collection. It can be taken even further by creating a function called <strong>Convert-ArgumentsToDictionary</strong> which will convert the value pairs into a Dictionary (Hashtable).&#160; <strong>Convert-ArgumentsToDictionary</strong> takes two parameters: The first is the parsed StringCollection and the second is a character that denotes a parameter. In the argument string above, the ‘-‘ character denotes a parameter.</p>
<p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450">
<p><font size="1">function Convert-ArgumentsToDictionary                <br />{                 <br />&#160;&#160;&#160; Param([System.Collections.Specialized.StringCollection] $Params, [char] $ParamIndicator)                 <br />&#160;&#160;&#160; $Dictionary = New-Object System.Collections.Specialized.StringDictionary                 <br />&#160;&#160;&#160; for($index = 0; $index -lt $Params.Count; $index++)                 <br />&#160;&#160;&#160; {                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; [string]$param = $Params[$index]                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; #Clear the values                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $key = &quot;&quot;                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $value = &quot;&quot; </font></p>
<p><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; if($param.StartsWith($ParamIndicator))                <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; #Remove the indicator                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $key = $param.Remove(0,1)                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if($index&#160; + 1 -lt $Params.Count)                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; #Check if the next Argument is a parameter                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [string]$param = $Params[$index + 1]                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if($param.StartsWith($ParamIndicator) -ne $true )                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; #If it isn&#8217;t a parameter then set it as the value                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $value = $param                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $index++                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $Dictionary[$key] = $value                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }#else skip                 <br />&#160;&#160;&#160; }                 <br />&#160;&#160;&#160; return $Dictionary                 <br />}</font></p>
</td>
</tr>
</tbody>
</table>
</p>
<p>Once the parsed arguments are converted to a Dictionary, simply check for the parameter name and it will return the value. </p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450">
<p><font size="1">$value = $Dictionary[“Parameter”] </font></p>
<p><font size="1">if($value –eq $null){</font></p>
<p><font size="1">Write-Host “Parameter = {0}” – f $value</font></p>
<p><font size="1">}</font></p>
</td>
</tr>
</tbody>
</table>
<p>The following script utilizes the functions described above:</p>
<p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450"><font size="1">#Verify that the $CommandLine variable exists              <br />if($CommandLine -ne $null -and $CommandLine -ne &quot;&quot;)               <br />{               <br />&#160;&#160;&#160; $Arguments = Parse-Commandline $CommandLine               <br />&#160;&#160;&#160; #Convert the Arguments. Use &#8211; as the Argument Indicator               <br />&#160;&#160;&#160; $Dictionary= Convert-ArgumentsToHashtable $Arguments &#8216;-&#8217;               <br />&#160;&#160;&#160; #Output the original command line string               <br />&#160;&#160;&#160; &quot;Command Line: {0}`r`n&quot; -f $CommandLine | Write-Output               <br />&#160;&#160;&#160; #Output the Dictionary in a formatted table               <br />&#160;&#160;&#160; $<font size="1">Dictionary</font> | Format-Table @{label=&quot;Key&quot;;Expression={$_.Key}},@{label=&quot;Value&quot;;Expression={$_.Value}} | Out-String | Write-Output               <br />}               <br />else               <br />{               <br />&#160;&#160;&#160; #Not running in a packager or no command line arguments passed               <br />&#160;&#160;&#160; Write-Output &quot;There are no command line arguments to parse.&quot;               <br />}</font></td>
</tr>
</tbody>
</table>
<p>The script verifies the $CommandLine variable is not null because it only exists in the package’s Script Host. Then the function are used to parse the $CommandLine variable and convert it to a Dictionary. Once the Dictionary is generated, the contents are formatted and displayed. </p>
<p>The results are as follows:</p>
<p>
<table border="1" cellspacing="0" cellpadding="2" width="450">
<tbody>
<tr>
<td valign="top" width="450">
<p><font size="1">***Run Powershell***                <br />Command Line: &quot;-Parameter1&quot; &quot;Value1&quot; &quot;-Parameter2&quot; &quot;Value2&quot; </font></p>
<p><font size="1">Key&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#8212;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8211;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Parameter2&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Value2&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Parameter1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Value1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></p>
<p><font size="1">***Exiting Powershell***</font></p>
</td>
</tr>
</tbody>
</table>
<p>You should now have a better understanding on how do use command line arguments with your packaged scripts. Feel free to use and customize these functions to make accessing&#160; the command line arguments quick and easy.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F02%2F09%2Fprimalforms-2009-the-packager-and-command-line-arguments%2F&amp;title=PrimalForms+2009%3A+The+Packager+and+Command+line+Arguments" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F02%2F09%2Fprimalforms-2009-the-packager-and-command-line-arguments%2F&amp;title=PrimalForms+2009%3A+The+Packager+and+Command+line+Arguments" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F02%2F09%2Fprimalforms-2009-the-packager-and-command-line-arguments%2F&amp;title=PrimalForms+2009%3A+The+Packager+and+Command+line+Arguments" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F02%2F09%2Fprimalforms-2009-the-packager-and-command-line-arguments%2F&amp;title=PrimalForms+2009%3A+The+Packager+and+Command+line+Arguments" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F02%2F09%2Fprimalforms-2009-the-packager-and-command-line-arguments%2F&amp;title=PrimalForms+2009%3A+The+Packager+and+Command+line+Arguments', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F02%2F09%2Fprimalforms-2009-the-packager-and-command-line-arguments%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F02%2F09%2Fprimalforms-2009-the-packager-and-command-line-arguments%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F02%2F09%2Fprimalforms-2009-the-packager-and-command-line-arguments%2F&amp;title=PrimalForms+2009%3A+The+Packager+and+Command+line+Arguments" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F02%2F09%2Fprimalforms-2009-the-packager-and-command-line-arguments%2F&amp;title=PrimalForms+2009%3A+The+Packager+and+Command+line+Arguments" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/commandline' rel='tag' target='_self'>commandline</a>, <a class='technorati-link' href='http://technorati.com/tag/Packager' rel='tag' target='_self'>Packager</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalForms' rel='tag' target='_self'>PrimalForms</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalScript+2009' rel='tag' target='_self'>PrimalScript 2009</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.sapien.com/index.php/2010/02/09/primalforms-2009-the-packager-and-command-line-arguments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PrimalForms 2009: OnApplicationLoad Function</title>
		<link>http://blog.sapien.com/index.php/2010/01/06/primalforms-2009-onapplicationload-function/</link>
		<comments>http://blog.sapien.com/index.php/2010/01/06/primalforms-2009-onapplicationload-function/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 18:23:52 +0000</pubDate>
		<dc:creator>David Corrales</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[PrimalForms]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[PrimalForm]]></category>
		<category><![CDATA[Winforms]]></category>

		<guid isPermaLink="false">http://blog.sapien.com/index.php/2010/01/06/primalforms-2009-onapplicationload-function/</guid>
		<description><![CDATA[Recently on the forums we had a user who wanted to know why he couldn’t initialize the form controls within the OnApplicationLoad function. Seeing how this can result in some confusion, we would like to elaborate on the subject.
The purpose of OnApplicationLoad is to initialize any dependencies necessary for your form script to run, such [...]]]></description>
			<content:encoded><![CDATA[<p>Recently on the forums we had a user who wanted to know why he couldn’t initialize the form controls within the <strong>OnApplicationLoad</strong> function. Seeing how this can result in some confusion, we would like to elaborate on the subject.</p>
<p>The purpose of <strong>OnApplicationLoad</strong> is to initialize any dependencies necessary for your form script to run, such as PSSnapins. In the case where the necessary dependencies are unavailable, you can return <em>$false</em> and the form will not display.</p>
<p>To understand why you can’t access the form controls within the <strong>OnApplicationLoad</strong> function, you need to understand when and where the <strong>OnApplicationLoad</strong> is called. </p>
<p>The following diagram demonstrates the process flow of the generated script:</p>
<p><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="189" alt="image" src="http://blog.sapien.com/wp-content/uploads/2009/12/image3.png" width="240" border="0" /> </p>
</p>
<p>As you can see the <strong>OnApplicationLoad</strong> is called before the <strong>GenerateForm</strong> function is called. If the <strong>OnApplicationLoad</strong> returns <em>$true</em>, the script will call the <strong>GenerateForm</strong> function, which contains the form code including your custom event scripts; therefore the controls are only exist in the scope of this function. Once the form is closed, the <strong>OnApplicationExit</strong> function is called. The <strong>OnApplicationExit</strong> function can be used to remove any dependencies you may have included. Like the <strong>OnApplicationLoad</strong>, the form controls are out of scope when the <strong>OnApplicationExit</strong> is called.</p>
<p>Since the form controls are not accessible by the <strong>OnApplicationLoad</strong> function where can you dynamically initialize the controls? The answer lies in the Form’s Load event. The Load event will fire the right before the form is displayed, but after the controls are defined, making the event an ideal location for initialization.</p>
<p>To add a Load event handler simply double click on the Form in the Designer or use the Properties Panel’s Events Tab and type in the event hander name next to the Load entry.</p>
<p><img title="Properties Load Event" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="222" alt="Properties Load Event" src="http://blog.sapien.com/wp-content/uploads/2009/12/PropertiesLoadEvent.png" width="323" border="0" /> </p>
<p>Now that you have a Load Event Handler you can use Read-Host or other methods to initialize your controls.</p>
<p>&#160;<a href="http://blog.sapien.com/wp-content/uploads/2009/12/LoadEventScriptBlock1.png"><img title="Load Event Script Block" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="69" alt="Load Event Script Block" src="http://blog.sapien.com/wp-content/uploads/2009/12/LoadEventScriptBlock_thumb.png" width="244" border="0" /></a></p>
<p>PrimalForms 2009 includes various sample forms and one of particular interest to this subject is SystemInformation.pff. If you refer to the SystemInformation.pff sample, you will notice that in the <strong>OnApplicationLoad</strong> is used to prompt the user for the path to a text file that contains a list of computer names. The path is stored in a script scope variable: <em>$script:list</em>. If the file is not found, the <strong>OnApplicationLoad</strong> returns <em>$false</em> and the form is never displayed.</p>
<p>&#160;<a href="http://blog.sapien.com/wp-content/uploads/2009/12/SystemInformationSampleOnApplicationLoad.png"><img title="SystemInformationSampleOnApplicationLoad" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="111" alt="SystemInformationSampleOnApplicationLoad" src="http://blog.sapien.com/wp-content/uploads/2009/12/SystemInformationSampleOnApplicationLoad_thumb.png" width="244" border="0" /></a> </p>
<p>In the form’s Load event ($PopulateList), the script calls uses the <em>$list</em> variable (initialized in <strong>OnApplicationLoad</strong>) to load a list of computer names into a ComboBox control. Since the <em>$list</em> variable was declared in the script scope, the Load event is able to access it.</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2009/12/LoadEventPopulateList1.png"><img title="Load Event Populate List" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="81" alt="Load Event Populate List" src="http://blog.sapien.com/wp-content/uploads/2009/12/LoadEventPopulateList_thumb.png" width="244" border="0" /></a>&#160;</p>
<p>To recap, the <strong>OnApplicationLoad</strong> function is used to pre-initialize your script, but it <em>can not</em> access the form controls. Instead it is recommended to use the Load event of the form to directly initialize the controls. </p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F01%2F06%2Fprimalforms-2009-onapplicationload-function%2F&amp;title=PrimalForms+2009%3A+OnApplicationLoad+Function" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F01%2F06%2Fprimalforms-2009-onapplicationload-function%2F&amp;title=PrimalForms+2009%3A+OnApplicationLoad+Function" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F01%2F06%2Fprimalforms-2009-onapplicationload-function%2F&amp;title=PrimalForms+2009%3A+OnApplicationLoad+Function" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F01%2F06%2Fprimalforms-2009-onapplicationload-function%2F&amp;title=PrimalForms+2009%3A+OnApplicationLoad+Function" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F01%2F06%2Fprimalforms-2009-onapplicationload-function%2F&amp;title=PrimalForms+2009%3A+OnApplicationLoad+Function', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F01%2F06%2Fprimalforms-2009-onapplicationload-function%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F01%2F06%2Fprimalforms-2009-onapplicationload-function%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F01%2F06%2Fprimalforms-2009-onapplicationload-function%2F&amp;title=PrimalForms+2009%3A+OnApplicationLoad+Function" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2010%2F01%2F06%2Fprimalforms-2009-onapplicationload-function%2F&amp;title=PrimalForms+2009%3A+OnApplicationLoad+Function" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/function' rel='tag' target='_self'>function</a>, <a class='technorati-link' href='http://technorati.com/tag/Howto' rel='tag' target='_self'>Howto</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalForm' rel='tag' target='_self'>PrimalForm</a>, <a class='technorati-link' href='http://technorati.com/tag/Winforms' rel='tag' target='_self'>Winforms</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.sapien.com/index.php/2010/01/06/primalforms-2009-onapplicationload-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending PrimalSense for external PowerShell snapins</title>
		<link>http://blog.sapien.com/index.php/2009/12/07/extending-primalsense-for-external-powershell-snapins/</link>
		<comments>http://blog.sapien.com/index.php/2009/12/07/extending-primalsense-for-external-powershell-snapins/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 22:38:53 +0000</pubDate>
		<dc:creator>Alex Riedel</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[PrimalScript]]></category>
		<category><![CDATA[Software News]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[cmdlet]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[PrimalSense]]></category>
		<category><![CDATA[snapin]]></category>

		<guid isPermaLink="false">http://blog.sapien.com/?p=1954</guid>
		<description><![CDATA[Getting PrimalSense for a COM object that you didn&#8217;t have installed on your development machine is fairly simple: Copy the TLB file (type library) to you machine, associate it to a progid and you are all set.
With PowerShell Cmdlets it is not quite that easy. Say you have to use a snapin that is only [...]]]></description>
			<content:encoded><![CDATA[<p>Getting PrimalSense for a COM object that you didn&#8217;t have installed on your development machine is fairly simple: Copy the TLB file (type library) to you machine, associate it to a progid and you are all set.</p>
<p>With PowerShell Cmdlets it is not quite that easy. Say you have to use a snapin that is only available on 64 bit but your development machine (and PrimalScript) are 32 bit. Maybe your snapin only installs on a server OS but not on your new Windows 7 laptop? Since snapins are assemblies and not just data files they may not be able to be loaded outside of their intended environment. So neither PrimalScript nor your local PowerShell may have any way of extracting type information.</p>
<p>But as you may have guessed, we created a way to get PrimalSense for snapins that you don&#8217;t even have installed.</p>
<p>We will use Quest&#8217;s AD snapin to illustrate the process:</p>
<p>1. On the computer where the snapin is installed and registered, run add-pssnapin to load it:<br />add-pssnapin Quest.ActiveRoles.admanagement</p>
<p>2. Export the CmdLets in that file into a text file.<br />get-command -syntax -pssnapin Quest.ActiveRoles.admanagement &gt;PSH.external</p>
<p>3. Copy that text file to your computer and load it into PrimalScript and remove all empty lines.</p>
<p>4. Right click in the file, select Properties&#8230; and change the encoding from Unicode to ANSI.</p>
<p>5. Copy the file to the languages folder where PrimalScript is installed (e.g. C:\Program Files\SAPIEN Technologies, Inc\PrimalScript 2009\languages) or merge it with a file of that name that may already exist.</p>
<p>Restart PrimalScript and the Cmdlets should be color coded and you should get PrimalSense as well.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="210" alt="image" src="http://blog.sapien.com/wp-content/uploads/2009/12/image.png" width="338" border="0"></p>
<p>You will need PrimalScript 2009 build 621 (5.0.621) at the very least.</p>
<p>We know that this is a very manual process and can be automated more, but we know it is necessary to put it out as soon as possible. We will work to streamline this and make it easier as soon as we can.</p>
<p>We will have a snapin/module exporter and an import function in PrimalScript right after Christmas.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F12%2F07%2Fextending-primalsense-for-external-powershell-snapins%2F&amp;title=Extending+PrimalSense+for+external+PowerShell+snapins" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F12%2F07%2Fextending-primalsense-for-external-powershell-snapins%2F&amp;title=Extending+PrimalSense+for+external+PowerShell+snapins" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F12%2F07%2Fextending-primalsense-for-external-powershell-snapins%2F&amp;title=Extending+PrimalSense+for+external+PowerShell+snapins" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F12%2F07%2Fextending-primalsense-for-external-powershell-snapins%2F&amp;title=Extending+PrimalSense+for+external+PowerShell+snapins" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F12%2F07%2Fextending-primalsense-for-external-powershell-snapins%2F&amp;title=Extending+PrimalSense+for+external+PowerShell+snapins', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F12%2F07%2Fextending-primalsense-for-external-powershell-snapins%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F12%2F07%2Fextending-primalsense-for-external-powershell-snapins%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F12%2F07%2Fextending-primalsense-for-external-powershell-snapins%2F&amp;title=Extending+PrimalSense+for+external+PowerShell+snapins" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F12%2F07%2Fextending-primalsense-for-external-powershell-snapins%2F&amp;title=Extending+PrimalSense+for+external+PowerShell+snapins" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/cmdlet' rel='tag' target='_self'>cmdlet</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalScript' rel='tag' target='_self'>PrimalScript</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalSense' rel='tag' target='_self'>PrimalSense</a>, <a class='technorati-link' href='http://technorati.com/tag/snapin' rel='tag' target='_self'>snapin</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.sapien.com/index.php/2009/12/07/extending-primalsense-for-external-powershell-snapins/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Connecting PrimalSQL to MySQL 5.1</title>
		<link>http://blog.sapien.com/index.php/2009/10/27/connecting-primalsql-to-mysql-5-1/</link>
		<comments>http://blog.sapien.com/index.php/2009/10/27/connecting-primalsql-to-mysql-5-1/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 18:59:29 +0000</pubDate>
		<dc:creator>Ferdinand Rios</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PrimalSQL]]></category>
		<category><![CDATA[PrimalTools]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://blog.sapien.com/?p=1880</guid>
		<description><![CDATA[Many organizations use MySQL as the back end database to their web sites and other infrastructure operations. While MySQL offers its own set of GUI too for database management, using a generic database tool like PrimalSQL has several advantages, especially when operating in a mixed database environment.
It is fairly simple to connect PrimalSQL to your [...]]]></description>
			<content:encoded><![CDATA[<p>Many organizations use MySQL as the back end database to their web sites and other infrastructure operations. While MySQL offers its own set of GUI too for database management, using a generic database tool like PrimalSQL has several advantages, especially when operating in a mixed database environment.</p>
<p>It is fairly simple to connect PrimalSQL to your MySQL 5.1 database. Follow the outlined steps below and you will be connected in no time!</p>
<p>1) Presumably you have a MySQL 5.1 database installed either locally or on a server somewhere. If you want to test this on a new installation, you can download MwSQL 5.1 from <a href="http://www.mysql.com">http://www.mysql.com</a>. Select the OS that you will be installing under and download the MSI. Its a fairly straight forward install which walks you through creation of an account, etc. Be sure to download the ODBC connector and install that as well. Optionally, you may want to download and install the MySQL Gui tools, but, hey, what we really want to do is use PrimalSQL, right?</p>
<p>2) Once you have MySQL installed, create an ODBC connection using the Data Sources Control Panel applet. Once you have ODBC Data Source Administrator window open, create a User DSN or system DSN by adding a new data source. Select &#8220;MySQL ODBC 5.1 Driver as the driver and press Finish.</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2009/10/image1.png"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" src="http://blog.sapien.com/wp-content/uploads/2009/10/image_thumb1.png" border="0" alt="Create New Data Source" width="244" height="185" /></a></p>
<p>This will pop up the MySQL Connector/ODBC Data Source Configuration window. Fill in a name for your DSN, description, server location (in this case localhost). The port defaults to 3306. You also need to fill in your MySQL credentials. Optionally, you can select the default database as well from the dropdown. Test the connection. If all is well, press OK to create the data source.</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2009/10/image2.png"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" src="http://blog.sapien.com/wp-content/uploads/2009/10/image_thumb2.png" border="0" alt="MySQL Connector" width="244" height="236" /></a></p>
<p>3) Open PrimalSQL. Click the Connection button on the ribbon and select New.</p>
<p>4) In the Provider Pane of the Data Link Properties window, select Microsoft OLE DB Provider for ODBC Drivers and press Next.<a href="http://blog.sapien.com/wp-content/uploads/2009/10/image3.png"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" src="http://blog.sapien.com/wp-content/uploads/2009/10/image_thumb3.png" border="0" alt="Data Link Properties Provider pane" width="193" height="244" /></a></p>
<p>5) On the Connection pane, select the MySQL DSN that you created in step 2 under Use Data Source Name. Enter your credentials and select an initial catalog. Test the connection. If all goes well, press OK.</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2009/10/image4.png"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" src="http://blog.sapien.com/wp-content/uploads/2009/10/image_thumb4.png" border="0" alt="Data Link Properties Connection pane" width="193" height="244" /></a></p>
<p>6) A new Connection will show up in the PrimalSQL Database Browser panel. Rename it to something that makes sense to you.</p>
<p>7) Double click the connection to connect it. Right click on the connection and select Set As Active Connection.</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2009/10/Screen-shot-2009-10-22-at-10.49.00-AM.png"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" src="http://blog.sapien.com/wp-content/uploads/2009/10/Screen-shot-2009-10-22-at-10.49.00-AM_thumb.png" border="0" alt="PrimalSQL Database Browser" width="205" height="238" /></a></p>
<p> <img src='http://blog.sapien.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> You should be able to see your Stored procedures, views and tables listed under the connection. PrimalSQL will allow you to query your tables using the Visual Query Builder or by writing SQL code. At this time, PrimalSQL does not support the editing of Stored Procedures in MySQL.</p>
<p>PrimalSQL is available as a free 45 day trial at <a href="http://www.primaltools.com">http://www.primaltools.com</a>. Check it out and let us know what you think.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F27%2Fconnecting-primalsql-to-mysql-5-1%2F&amp;title=Connecting+PrimalSQL+to+MySQL+5.1" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F27%2Fconnecting-primalsql-to-mysql-5-1%2F&amp;title=Connecting+PrimalSQL+to+MySQL+5.1" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F27%2Fconnecting-primalsql-to-mysql-5-1%2F&amp;title=Connecting+PrimalSQL+to+MySQL+5.1" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F27%2Fconnecting-primalsql-to-mysql-5-1%2F&amp;title=Connecting+PrimalSQL+to+MySQL+5.1" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F27%2Fconnecting-primalsql-to-mysql-5-1%2F&amp;title=Connecting+PrimalSQL+to+MySQL+5.1', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F27%2Fconnecting-primalsql-to-mysql-5-1%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F27%2Fconnecting-primalsql-to-mysql-5-1%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F27%2Fconnecting-primalsql-to-mysql-5-1%2F&amp;title=Connecting+PrimalSQL+to+MySQL+5.1" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F27%2Fconnecting-primalsql-to-mysql-5-1%2F&amp;title=Connecting+PrimalSQL+to+MySQL+5.1" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/PrimalSQL' rel='tag' target='_self'>PrimalSQL</a>, <a class='technorati-link' href='http://technorati.com/tag/sql' rel='tag' target='_self'>sql</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.sapien.com/index.php/2009/10/27/connecting-primalsql-to-mysql-5-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Closing the Form: What you might expect and what really happens</title>
		<link>http://blog.sapien.com/index.php/2009/10/19/closing-the-form-what-you-might-expect-and-what-really-happens/</link>
		<comments>http://blog.sapien.com/index.php/2009/10/19/closing-the-form-what-you-might-expect-and-what-really-happens/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 15:52:59 +0000</pubDate>
		<dc:creator>David Corrales</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[PrimalForms]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Winforms]]></category>

		<guid isPermaLink="false">http://blog.sapien.com/index.php/2009/10/19/closing-the-form-what-you-might-expect-and-what-really-happens/</guid>
		<description><![CDATA[Recently I was contacted by one of our PrimalForms users. He commented that the behavior of a script deviated from what he was expecting. He provided me with the following script block for the Button Click Event so that I could help clear up the confusion:
$handler_button3_Click={     # Check that a logfile [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was contacted by one of our PrimalForms users. He commented that the behavior of a script deviated from what he was expecting. He provided me with the following script block for the Button Click Event so that I could help clear up the confusion:</p>
<blockquote><p>$handler_button3_Click={     <br /># Check that a logfile was specified. If not close the form.      <br />if ( $textbox2.text -eq &quot;&quot; )      <br />{      <br />Write-host &quot;No Logfile, closing&quot;      <br />$form1.close()      <br />} # A logfile was specified      <br />Write-Host &quot;I have the logfile&quot;      <br />}</p>
</blockquote>
<p>As you can see, the user is testing to make sure that the the name of the log file was entered into the textbox. If the value is empty, the script will close the form. This is where the behavior deviates from what the user expects. When the user presses the button with the textbox empty, the script generates the following output:</p>
<p><img title="Unexpected Output" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="160" alt="Unexpected Output" src="http://blog.sapien.com/wp-content/uploads/2009/09/UnexpectedOutput1.png" width="283" border="0" /></p>
<p>PowerShell continues to execute the last line despite the fact that the script closed the form in the following line. The user’s perception was that the script block will stop executing after the form was closed, but that is not the case. The reason is that PowerShell is not dependent on the form to execute the script, thus it continues to process the rest of script. To PowerShell the $form1.Close() line is just another command to execute. Since PowerShell does not stop the script when the form is closed, the script block needs to be modified in order prevent the execution of the rest of the script. Below I present two alternatives to prevent this from happening:</p>
<p>Add&#160; “return” command after closing the form:</p>
<blockquote><p>$handler_button3_Click={     <br /># Check that a logfile was specified. If not close the form.      <br />if ( $textbox2.text -eq &quot;&quot; )      <br />{      <br />Write-host &quot;No Logfile, closing&quot;      <br />$form1.close()      <br />return #exit the script block      <br />} # A logfile was specified      <br />Write-Host &quot;I have the logfile&quot;      <br />}</p>
</blockquote>
<p>An alternative would be to add in an “else” statement:</p>
<blockquote><p>$handler_button3_Click={     <br /># Check that a logfile was specified. If not close the form.      <br />if ( $textbox2.text -eq &quot;&quot; )      <br />{      <br />Write-host &quot;No Logfile, closing&quot;      <br />$form1.close()      <br />} # A logfile was specified      <br />else #add else statement      <br />{      <br />Write-Host &quot;I have the logfile&quot;      <br />}      <br />}</p>
</blockquote>
<p>The corrected script block generates the expected output:</p>
<p><img title="Corrected Output" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="144" alt="Corrected Output" src="http://blog.sapien.com/wp-content/uploads/2009/09/CorrectedOutput1.png" width="270" border="0" /></p>
<p>As demonstrated, forms in PowerShell may not behave as expected. Users must keep in mind that PowerShell will continue to execute the remaining lines in a script even after closing the form in a previous line; therefore, users must accommodate accordingly.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F19%2Fclosing-the-form-what-you-might-expect-and-what-really-happens%2F&amp;title=Closing+the+Form%3A+What+you+might+expect+and+what+really+happens" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F19%2Fclosing-the-form-what-you-might-expect-and-what-really-happens%2F&amp;title=Closing+the+Form%3A+What+you+might+expect+and+what+really+happens" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F19%2Fclosing-the-form-what-you-might-expect-and-what-really-happens%2F&amp;title=Closing+the+Form%3A+What+you+might+expect+and+what+really+happens" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F19%2Fclosing-the-form-what-you-might-expect-and-what-really-happens%2F&amp;title=Closing+the+Form%3A+What+you+might+expect+and+what+really+happens" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F19%2Fclosing-the-form-what-you-might-expect-and-what-really-happens%2F&amp;title=Closing+the+Form%3A+What+you+might+expect+and+what+really+happens', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F19%2Fclosing-the-form-what-you-might-expect-and-what-really-happens%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F19%2Fclosing-the-form-what-you-might-expect-and-what-really-happens%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F19%2Fclosing-the-form-what-you-might-expect-and-what-really-happens%2F&amp;title=Closing+the+Form%3A+What+you+might+expect+and+what+really+happens" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F19%2Fclosing-the-form-what-you-might-expect-and-what-really-happens%2F&amp;title=Closing+the+Form%3A+What+you+might+expect+and+what+really+happens" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/forms' rel='tag' target='_self'>forms</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalForms' rel='tag' target='_self'>PrimalForms</a>, <a class='technorati-link' href='http://technorati.com/tag/Winforms' rel='tag' target='_self'>Winforms</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.sapien.com/index.php/2009/10/19/closing-the-form-what-you-might-expect-and-what-really-happens/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PrimalForms 2009: Integrated Help</title>
		<link>http://blog.sapien.com/index.php/2009/10/01/primalforms-2009-integrated-help/</link>
		<comments>http://blog.sapien.com/index.php/2009/10/01/primalforms-2009-integrated-help/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 17:00:00 +0000</pubDate>
		<dc:creator>David Corrales</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[PrimalForms]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[Help]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Winforms]]></category>

		<guid isPermaLink="false">http://blog.sapien.com/?p=1758</guid>
		<description><![CDATA[PrimalForms 2009 features integrated help to assist users with their form scripting. This blog covers some of its features.
Help Documentation:

(Fig 1: Click on the Help button or press F1 key to access the help documentation.)
PrimalForms allows users to access help on any panel or window simply by pressing the F1 key. Depending on the active [...]]]></description>
			<content:encoded><![CDATA[<p>PrimalForms 2009 features integrated help to assist users with their form scripting. This blog covers some of its features.</p>
<p><strong>Help Documentation:</strong></p>
<p><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="HelpButton" src="http://blog.sapien.com/wp-content/uploads/2009/09/HelpButton1.png" border="0" alt="HelpButton" width="284" height="148" /></p>
<p>(Fig 1: Click on the Help button or press F1 key to access the help documentation.)</p>
<p>PrimalForms allows users to access help on any panel or window simply by pressing the F1 key. Depending on the active window, help will take the user to the corresponding Help topic. For example, if a user would like more information on the Assemblies Panel, the user simply have to click on the Assemblies Panel and press the F1 key. The Help document will then open and display the “Assemblies Panel” topic. This help applies to all windows in the application.</p>
<p>In addition to application help topics, the Help Documentation features a “Getting Started” Section which is designed to instruct new users on how to create their very first form. The guide also covers some basic controls and how to incorporate them in your forms.</p>
<p><strong>Help and t<strong>he Script Editor</strong>:</strong></p>
<p>The F1 key plays an additional role in the Script Editor. The F1 key can provide the user with information on cmdlets and variable types, depending on the position of the caret in the editor. For example, if the user clicks on a cmdlet name in the script and presses the F1 key, the help documentation for the cmdlet will be displayed in the Help Panel and highlighted in the PowerShell Panel. Cmdlet help information is also automatically displayed when the user types the space character after the cmdlet name.</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2009/09/CmdletHelp3.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="CmdletHelp" src="http://blog.sapien.com/wp-content/uploads/2009/09/CmdletHelp_thumb3.png" border="0" alt="CmdletHelp" width="244" height="171" /></a></p>
<p>(Fig 2: Cmdlet Help)</p>
<p style="padding-left: 30px"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="Tip" src="http://blog.sapien.com/wp-content/uploads/2009/10/Tip3.png" border="0" alt="Tip" width="32" height="32" /> TIP: Just like the script editor, the Help Panel features a split view display to allow users to view two separate sections of the cmdlet help at the same time.</p>
<p style="padding-left: 30px"><a href="http://blog.sapien.com/wp-content/uploads/2009/09/SplitViewHelpPanel1.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="SplitViewHelpPanel" src="http://blog.sapien.com/wp-content/uploads/2009/09/SplitViewHelpPanel_thumb1.png" border="0" alt="SplitViewHelpPanel" width="244" height="108" /></a></p>
<p style="padding-left: 30px">(Fig 3: Help Panel Split View)</p>
<p>Additional help information is displayed when a user hovers the cursor over a cmdlet or variable.</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2009/09/CmdletHover1.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="CmdletHover" src="http://blog.sapien.com/wp-content/uploads/2009/09/CmdletHover_thumb1.png" border="0" alt="CmdletHover" width="244" height="65" /></a></p>
<p>(Fig 3: Cmdlet parameters are displayed)</p>
<p><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="variableHover" src="http://blog.sapien.com/wp-content/uploads/2009/09/variableHover2.png" border="0" alt="variableHover" width="369" height="140" /></p>
<p>(Fig 4: Variable types are displayed)</p>
<p><strong>.NET Object Browser:</strong></p>
<p>Not only does the F1 display the cmdlet help, but users can use the F1 key to find the type information for variables, properties, and methods in the .Net Object Browser.</p>
<p style="padding-left: 30px"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="Tip" src="http://blog.sapien.com/wp-content/uploads/2009/10/Tip3.png" border="0" alt="Tip" width="32" height="32" /> TIP: Pressing the F1 key on variables selected in the script editor, automatically selects the corresponding type in the .NET Object Browser, thus saving the users from having to manually search the browser. For example, pressing the F1 key on the $form variable, results in the selection of System.Windows.Forms.Form object in the .NET Object Browser.</p>
<p>The .NET Object Browse is used to display all the objects contained in the .NET assemblies. The objects are grouped by assembly and namespace. It allows users to view all the properties and methods of particular objects / controls, including their static members.</p>
<p><strong>Accessing Static Members:</strong></p>
<p>Static members are properties or methods that are shared by an object type and are not instantiated with the object. In other words, it does not depends on an object (variable) to be created, in order to access these members. In PowerShell, accessing a static member is differentiated from accessing a variable member.</p>
<p>Accessing a typical variable property:</p>
<p><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="AccessMember" src="http://blog.sapien.com/wp-content/uploads/2009/09/AccessMember3.png" border="0" alt="AccessMember" width="324" height="67" /></p>
<p>Accessing a static property:</p>
<p><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="AccessStaticMember" src="http://blog.sapien.com/wp-content/uploads/2009/09/AccessStaticMember3.png" border="0" alt="AccessStaticMember" width="343" height="66" /></p>
<p>As you can see, users must specify the class name in brackets and use the “::” operator to access a static member. Users familiar with C#, will notice that PowerShell deviates from what they would expect to see in C#.</p>
<p style="padding-left: 30px"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="Tip" src="http://blog.sapien.com/wp-content/uploads/2009/10/Tip3.png" border="0" alt="Tip" width="32" height="32" /> TIP: Static methods and properties are differentiated by their blue tone in the .NET Object Browser</p>
<p style="padding-left: 30px"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="Tip" src="http://blog.sapien.com/wp-content/uploads/2009/10/Tip3.png" border="0" alt="Tip" width="32" height="32" /> TIP: Double click on a static member in the .NET Object Browser will save you having to type out the static member call</p>
<p style="padding-left: 30px"><a href="http://blog.sapien.com/wp-content/uploads/2009/09/DoubleClickInsert2.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="DoubleClickInsert" src="http://blog.sapien.com/wp-content/uploads/2009/09/DoubleClickInsert_thumb2.png" border="0" alt="DoubleClickInsert" width="244" height="183" /></a></p>
<p style="padding-left: 30px">(Fig 5: Click on static prop -&gt; inserted text)</p>
<p style="padding-left: 30px"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="Tip" src="http://blog.sapien.com/wp-content/uploads/2009/10/Tip3.png" border="0" alt="Tip" width="32" height="32" /> TIP: Double clicking on cmdlet names in the PowerShell panel will insert the command</p>
<p><strong>MSDN Help:</strong></p>
<p style="padding-left: 30px"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="Tip" src="http://blog.sapien.com/wp-content/uploads/2009/10/Tip3.png" border="0" alt="Tip" width="32" height="32" /> TIP: If a user is unsure about a property or method, they can right click on the questionable object in the .NET Object Browser and select the “MSDN Help” menu option. This option will take the user to the Online MSDN Help Documentation, which provides type descriptions and samples.</p>
<p style="padding-left: 30px"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="MSDNHelp" src="http://blog.sapien.com/wp-content/uploads/2009/09/MSDNHelp1.png" border="0" alt="MSDNHelp" width="263" height="242" /></p>
<p style="padding-left: 30px">(Fig 6: MSDN Help context menu option)</p>
<p style="padding-left: 30px"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="Tip" src="http://blog.sapien.com/wp-content/uploads/2009/10/Tip3.png" border="0" alt="Tip" width="32" height="32" /> TIP: Users can also access the MSDN Help directly from the Toolbox Panel while working in the Designer tab.</p>
<p style="padding-left: 30px"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="MSDNHelpFromToolBar" src="http://blog.sapien.com/wp-content/uploads/2009/09/MSDNHelpFromToolBar2.png" border="0" alt="MSDNHelpFromToolBar" width="349" height="175" /></p>
<p style="padding-left: 30px">(Fig 7: MSDN Help context menu in Toolbox Panel)</p>
<p><strong>PrimalSense:</strong></p>
<p>Majority of the help is integrated directly into PrimalForms’ PrimalSense. For example, PrimalSense will list properties and methods of objects after users type the ‘.’ operator. Further more the PrimalSense will list all available variables, including all the form objects when typing the ‘$’ character.</p>
<p style="padding-left: 30px"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="Tip" src="http://blog.sapien.com/wp-content/uploads/2009/10/Tip3.png" border="0" alt="Tip" width="32" height="32" /> TIP: Use the Assembly Panel to expand PrimalSense’s type support. Added assemblies will automatically be added to the .NET Object Browser.</p>
<p>In addition, PrimalSense helps facilitate scripting by listing available cmdlets that match the verb the user is typing.</p>
<p><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="VerbSense" src="http://blog.sapien.com/wp-content/uploads/2009/09/VerbSense3.png" border="0" alt="VerbSense" width="280" height="200" /></p>
<p>(Fig 8: PrimalSense for cmdlet commands)</p>
<p>PrimalSense also assists users by displaying the parameters of a cmdlet. Furthermore, snapins added in the script are automatically integrated into PrimalForms’ PrimalSense and the PowerShell Panel.</p>
<p><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="ParameterSelect" src="http://blog.sapien.com/wp-content/uploads/2009/09/ParameterSelect3.png" border="0" alt="ParameterSelect" width="319" height="228" /></p>
<p>(Fig 9: PrimalSense for cmdlet parameters)</p>
<p>Hopefully with this blog, users have a better understanding of how to use PrimalForms 2009’s  integrated help to assist in their scripting.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F01%2Fprimalforms-2009-integrated-help%2F&amp;title=PrimalForms+2009%3A+Integrated+Help" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F01%2Fprimalforms-2009-integrated-help%2F&amp;title=PrimalForms+2009%3A+Integrated+Help" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F01%2Fprimalforms-2009-integrated-help%2F&amp;title=PrimalForms+2009%3A+Integrated+Help" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F01%2Fprimalforms-2009-integrated-help%2F&amp;title=PrimalForms+2009%3A+Integrated+Help" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F01%2Fprimalforms-2009-integrated-help%2F&amp;title=PrimalForms+2009%3A+Integrated+Help', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F01%2Fprimalforms-2009-integrated-help%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F01%2Fprimalforms-2009-integrated-help%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F01%2Fprimalforms-2009-integrated-help%2F&amp;title=PrimalForms+2009%3A+Integrated+Help" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F10%2F01%2Fprimalforms-2009-integrated-help%2F&amp;title=PrimalForms+2009%3A+Integrated+Help" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/forms' rel='tag' target='_self'>forms</a>, <a class='technorati-link' href='http://technorati.com/tag/Help' rel='tag' target='_self'>Help</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalForms' rel='tag' target='_self'>PrimalForms</a>, <a class='technorati-link' href='http://technorati.com/tag/Winforms' rel='tag' target='_self'>Winforms</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.sapien.com/index.php/2009/10/01/primalforms-2009-integrated-help/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synchronize folders with PrimalMerge</title>
		<link>http://blog.sapien.com/index.php/2009/09/28/synchronize-folders-with-primalmerge/</link>
		<comments>http://blog.sapien.com/index.php/2009/09/28/synchronize-folders-with-primalmerge/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 20:30:56 +0000</pubDate>
		<dc:creator>Ferdinand Rios</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[PrimalMerge 2009]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://blog.sapien.com/?p=1724</guid>
		<description><![CDATA[Ever run into a situation where you have 2 folders with identical file names in them but possibly different content in the files? You really don’t want to have to open each and every file to compare them and then copy the files from one folder to another, right? PrimalMerge to the rescue!
PrimalMerge has the [...]]]></description>
			<content:encoded><![CDATA[<p>Ever run into a situation where you have 2 folders with identical file names in them but possibly different content in the files? You really don’t want to have to open each and every file to compare them and then copy the files from one folder to another, right? PrimalMerge to the rescue!</p>
<p>PrimalMerge has the ability to compare complete folders of files and then allows you to synchronize those folders with each other. Let’s take a look at how this is done.</p>
<p>Start off by first opening the two folders that you want to compare. Do this by selecting the Application button and choosing “Open Directory…” from the menu. This option brings up the “Select directories to compare” dialog box. Within this box you can either type in the directory paths that you want to compare or click on the “…” button next to each path to select by browsing folders. Press the “OK” button when your choices have been made.</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2009/09/Screenshot20090928at10.51.40AM.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Screen shot 2009-09-28 at 10.51.40 AM" src="http://blog.sapien.com/wp-content/uploads/2009/09/Screenshot20090928at10.51.40AM_thumb.png" border="0" alt="Select Directories to Compare" width="244" height="72" /></a></p>
<p>PrimalMerge will open a window with 5 columns, showing the list of files from the folders selected. The first column displays the file name with an icon. A red icon indicates that the same file name exists in both folders, but that the file contents are different. This is also indicated in the “Comparison Result” column.</p>
<p><a href="http://blog.sapien.com/wp-content/uploads/2009/09/Screenshot20090928at10.52.03AM.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Screen shot 2009-09-28 at 10.52.03 AM" src="http://blog.sapien.com/wp-content/uploads/2009/09/Screenshot20090928at10.52.03AM_thumb.png" border="0" alt="PrimalMerge" width="244" height="142" /></a></p>
<p>A blue icon indicates that the same file exists in both folders and that they are identical. A half icon indicates that the file exists only in one of the two folders. These states are also displayed in the “Comparison Result” column.  You can use the “Left Date” (first folder) and “Right Date” (second folder) columns to compare which file is newer.</p>
<p>Here is where the magic takes place. Looking carefully at the sample above, you can see that some of the files in the “Right Date” column are newer and marked by an asterisk. Select all of the files in the list. Right click and select “Copy…Right to Left”. Viola! The newer files from the second folder replace the files in the first folder.</p>
<p>This is just a small example of some of the versatility in PrimalMerge. Download a 45 day free trial at http://www.primaltools.com/products/info.asp?p=PrimalMerge.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F09%2F28%2Fsynchronize-folders-with-primalmerge%2F&amp;title=Synchronize+folders+with+PrimalMerge" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F09%2F28%2Fsynchronize-folders-with-primalmerge%2F&amp;title=Synchronize+folders+with+PrimalMerge" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F09%2F28%2Fsynchronize-folders-with-primalmerge%2F&amp;title=Synchronize+folders+with+PrimalMerge" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F09%2F28%2Fsynchronize-folders-with-primalmerge%2F&amp;title=Synchronize+folders+with+PrimalMerge" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F09%2F28%2Fsynchronize-folders-with-primalmerge%2F&amp;title=Synchronize+folders+with+PrimalMerge', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F09%2F28%2Fsynchronize-folders-with-primalmerge%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F09%2F28%2Fsynchronize-folders-with-primalmerge%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F09%2F28%2Fsynchronize-folders-with-primalmerge%2F&amp;title=Synchronize+folders+with+PrimalMerge" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F09%2F28%2Fsynchronize-folders-with-primalmerge%2F&amp;title=Synchronize+folders+with+PrimalMerge" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/PrimalMerge+2009' rel='tag' target='_self'>PrimalMerge 2009</a>, <a class='technorati-link' href='http://technorati.com/tag/scripting' rel='tag' target='_self'>scripting</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.sapien.com/index.php/2009/09/28/synchronize-folders-with-primalmerge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
