<?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>Shedding Some Light &#187; Tips</title>
	<atom:link href="http://rickschummer.com/blog2/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://rickschummer.com/blog2</link>
	<description>Shedding some light on topics of software development, Visual FoxPro, saving our planet, paying it forward, and anything else I find important enough to share.</description>
	<lastBuildDate>Thu, 19 Mar 2026 20:55:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>MAKETRANSACTABLE() use</title>
		<link>http://rickschummer.com/blog2/2008/01/maketransactable-use/</link>
		<comments>http://rickschummer.com/blog2/2008/01/maketransactable-use/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 12:16:00 +0000</pubDate>
		<dc:creator>Rick Schummer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[VFP]]></category>

		<guid isPermaLink="false">http://rickschummer.com/blog2/2008/01/maketransactable-use/</guid>
		<description><![CDATA[Each time a new version of VFP is released I look at all the new commands and functions to see how I might be able to incorporate them into my user applications and developer tools. Each time I have found some function or command that makes me scratch my head and wonder what the Fox [...]]]></description>
			<content:encoded><![CDATA[<p>Each time a new version of VFP is released I look at all the new commands and functions to see how I might be able to incorporate them into my user applications and developer tools. Each time I have found some function or command that makes me scratch my head and wonder what the Fox Team had in mind. For VFP 9 this was MAKETRANSACTABLE().</p>
<p>At least this is how I felt about this command up to a month ago. I received a new mini-project from one of my clients who needed a basic import of some accounting data from an external program into their custom app. The external table was a free table created and/or updated by another program. The new records needed to be imported into another DBF contained in a database container. Once the records are imported I needed to stamp them as imported in the free table. Hmmm, sounds like something I would want to do inside a transaction, but I have this free table&#8230; ah, finally the perfect reason to use MAKETRANSACTABLE().</p>
<p>The funny thing about this is I have never tried the new command to see if it works {g}. It is rare for me to work with free tables in a production environment. Normally I work with SQL Server, or VFP contained tables.</p>
<p>So I tested it out and it does indeed work, and it works well. The odds of the import not working is very, very remote because I am only adding the new records to the database table (no updates of existing records), but I thought the extra security of doing it inside a transaction was worth the extra couple of commands to add to the code.</p>
<p>Here is some of the code so you can understand fundamentally what I did.
<pre><span style="font-size:85%;"><span style="font-family:courier new;">TRY</span><span style="font-family:courier new;">  USE (toParameter.cFeedFile) IN 0 EXCLUSIVE ALIAS (toParameter.cFeedFileAlias)</span><span style="font-family:courier new;">  SELECT (toParameter.cFeedFileAlias)</span><span style="font-family:courier new;">  INDEX ON TimPe TAG TimPe </span><span style="font-family:courier new;"> </span><span style="font-family:courier new;"> <span style="color: rgb(0, 153, 0);">* Allow the free table to work in a transaction</span></span>

<span style="font-family:courier new;">  MAKETRANSACTABLE(toParameter.cFeedFileAlias)</span>

<span style="font-family:courier new;"> <span style="color: rgb(0, 153, 0);">* Set buffering so entire table gets updated or can be reverted</span></span><span style="font-family:courier new;">  CURSORSETPROP("Buffering", 5, toParameter.cFeedFileAlias)</span><span style="font-family:courier new;"> </span><span style="font-family:courier new;"> <span style="color: rgb(0, 153, 0);">**** Open other tables...</span></span>

<span style="font-family:courier new;">CATCH TO loException</span><span style="font-family:courier new;">  toParameter.lOpenedAll = .F.</span><span style="font-family:courier new;">  toParameter.cTableUpdatedFailureMsg = "Failed opening tables - " + ;                                    loException.Message </span><span style="font-family:courier new;">ENDTRY</span>

<span style="color: rgb(0, 153, 0);font-family:courier new;">*** Handle processing of tables...</span>

<span style="color: rgb(0, 153, 0);font-family:courier new;">* Start a transaction so all changes can be backed out.</span>

<span style="font-family:courier new;">BEGIN TRANSACTION</span>

<span style="font-family:courier new;">toParameter.lDatabaseFileTableUpdatedResult = ;TABLEUPDATE(.T., .F., toParameter.cDataBaseFileAlias)</span>

<span style="font-family:courier new;">IF toParameter.lDatabaseFileTableUpdatedResult</span><span style="font-family:courier new;"> <span style="color: rgb(0, 153, 0);">* Continue on with the feed table update</span></span><span style="font-family:courier new;">  toParameter.lFeedFileTableUpdatedResult = ;  TABLEUPDATE(.T., .F., toParameter.cFeedFileAlias)</span><span style="font-family:courier new;"> </span><span style="font-family:courier new;">  IF toParameter.lFeedFileTableUpdatedResult</span><span style="font-family:courier new;"> <span style="color: rgb(0, 153, 0);">* All changes committed</span></span><span style="font-family:courier new;">    END TRANSACTION</span><span style="font-family:courier new;">  ELSE</span><span style="font-family:courier new;"> <span style="color: rgb(0, 153, 0);">* Record why</span></span><span style="font-family:courier new;">    AERROR(laError)</span><span style="font-family:courier new;">    toParameter.cTableUpdatedFailureMsg = laError[2]</span><span style="font-family:courier new;">  ENDIF</span><span style="font-family:courier new;">ELSE</span><span style="font-family:courier new;"> <span style="color: rgb(0, 153, 0);">* Record why</span></span><span style="font-family:courier new;">  AERROR(laError)</span><span style="font-family:courier new;">  toParameter.cTableUpdatedFailureMsg = laError[2]</span><span style="font-family:courier new;">ENDIF </span>

<span style="color: rgb(0, 153, 0);font-family:courier new;">* Determine the way to finish up.</span><span style="font-family:courier new;">IF toParameter.lDatabaseFileTableUpdatedResult AND ;</span><span style="font-family:courier new;">  toParameter.lFeedFileTableUpdatedResult</span><span style="font-family:courier new;"> <span style="color: rgb(0, 153, 0);">* All went well and is commited</span></span><span style="font-family:courier new;">ELSE </span><span style="font-family:courier new;"> <span style="color: rgb(0, 153, 0);">* Problems and rollback</span></span><span style="font-family:courier new;">  ROLLBACK </span><span style="font-family:courier new;">  TABLEREVERT(.T., toParameter.cDataBaseFileAlias)</span><span style="font-family:courier new;">  TABLEREVERT(.T., toParameter.cFeedFileAlias)</span><span style="font-family:courier new;">  toParameter.nRecordsInserted = 0 </span><span style="font-family:courier new;">ENDIF</span>

<span style="font-family:courier new;">RETURN</span></span></pre>
<p>I think it is cool when there are others that have a vision to incorporate things into Visual FoxPro that hit me years later how I can use them.</p>
]]></content:encoded>
			<wfw:commentRss>http://rickschummer.com/blog2/2008/01/maketransactable-use/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Consolas Font: Paying it forward</title>
		<link>http://rickschummer.com/blog2/2007/02/consolas-font-paying-it-forward/</link>
		<comments>http://rickschummer.com/blog2/2007/02/consolas-font-paying-it-forward/#comments</comments>
		<pubDate>Thu, 01 Feb 2007 09:00:00 +0000</pubDate>
		<dc:creator>Rick Schummer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[VFP]]></category>

		<guid isPermaLink="false">http://rickschummer.com/blog2/2007/02/consolas-font-paying-it-forward/</guid>
		<description><![CDATA[Last month at the Detroit Area Fox User Group, my friend Paul Mrozowski demoed a number of tools and tips he uses every day in his VFP and .NET development. It was a great presentation and one where I learned a number of new things. One of these tips is to use the Consolas font [...]]]></description>
			<content:encoded><![CDATA[<p>Last month at the Detroit Area Fox User Group, my friend Paul Mrozowski demoed a number of tools and tips he uses every day in his VFP and .NET development. It was a great presentation and one where I learned a number of new things. One of these tips is to use the Consolas font from Microsoft.</p>
<p>The Consolas font is a non-proportional font like Courier New, but is better in many respects. The first is it is heavier or thicker than the Courier New font, but it is narrower too. In my opinion it is easier to read and provides more text in the same space. Other big differences are number zero (is it the letter O or the numeric zero?), the possible semi-colon vs. colon confusion, and the comma vs. period. Here is an image with both fonts set at 12 point, bold:</p>
<p><img src="http://rickschummer.com/images/blog/ConsolasVsCourier.jpg" border="0" /></p>
<p>You can download the <a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3&amp;displaylang=en">Consolas Font Pack for Microsoft Visual Studio 2005</a> direct from Microsoft. It works with Visual FoxPro too <img src='http://rickschummer.com/blog2/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>I like to work with smaller fonts and work at a high resolution (1920&#215;1200) on a 15.4 inch wide screen monitor running Clear Type. I believe the eye strain I experience working long hours is reduced.</p>
<p>Thanks Paul for this simple, but fantastic tip!</p>
]]></content:encoded>
			<wfw:commentRss>http://rickschummer.com/blog2/2007/02/consolas-font-paying-it-forward/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
