<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Paul Mrozowski's Blog - VFP</title>
    <link>http://www.rcs-solutions.com/blog/</link>
    <description>A day in the life (of a developer)</description>
    <language>en-us</language>
    <copyright>Paul Mrozowski / RCS Solutions, Inc.</copyright>
    <lastBuildDate>Wed, 21 Jul 2010 21:15:53 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>paulm@rcs-solutions.com</managingEditor>
    <webMaster>paulm@rcs-solutions.com</webMaster>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=b5fe0773-5338-44b0-abc6-92e41f252101</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,b5fe0773-5338-44b0-abc6-92e41f252101.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,b5fe0773-5338-44b0-abc6-92e41f252101.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=b5fe0773-5338-44b0-abc6-92e41f252101</wfw:commentRss>
      <slash:comments>7</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A common pattern you tend to find in maintenance forms is the ability to open another
form so you can add/edit/maintain some list of items. When you return back to the
calling form you want to refresh a combo or grid to reflect the changes. The way most
of us do this is to make the maintenance form modal. When you call it, code execution
stops until the form is released. That works but it can break down if you find yourself
more than 1 level deep in maintenance forms – the user can’t easily move windows out
of the way to see information and you’ll occasionally find that the wrong form has
somehow gotten focus leaving you stuck (unable to get focus back to the correct form). 
</p>
        <p>
Here’s an example. The user starts off on the Client Maintenance form, then clicks
on the Commissary button (military grocery store) to select which stores are associated
with this client. Then they click on the Commissary button again if they want to add/edit
a new store. When they close this form we want to refresh the second form.
</p>
        <p>
 
</p>
        <p>
          <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/AlternativetoModalVFPForms_A10D/image_3.png" width="640" height="448" />
        </p>
        <p>
Again, the normal way you might do this is to make the third form modal.
</p>
        <pre style="background: #eeeeee">DO FORM CommissaryMaintenance
* When the form is closed the code below is run which saves and refreshes
* the options shown.
ThisForm.SaveAndRefresh()</pre>
        <p>
An alternative to this code (and making the form modal) is to do something like this
instead:
</p>
        <pre style="background: #eeeeee">DO FORM CommissaryMaintenance NAME loForm
BINDEVENT(loForm, “Destroy”, ThisForm, “SaveAndRefresh”)</pre>
        <p>
Now the form can stay modeless. We’re taking advantage of VFP’s BINDEVENT command.
When the form is closed and the Destroy() event fired we’ll fire the SaveAndRefresh()
method which refreshes the form. It’s simple and avoids the problems mentioned above. 
</p>
        <p>
One suggestion is to add code in the calling form to set focus back to itself (in
case you are mixing and matching modal and non-modal forms). Ex. in the SaveAndRefresh()
method you might want to do something like this:
</p>
        <pre style="background: #eeeeee">ThisForm.grdList.SetFocus()</pre>
        <p>
That will ensure that your form actually gets focus and back where the user is expecting
to be.
</p>
        <p>
This all works great, but what if you want to update the form as new items are add,
not just when the form closes? If you modify the maintenance form to call an empty
method after a successful save, ex. create a method named SaveSuccessful() you can
now bind to this method instead of Destroy().
</p>
        <pre style="background: #eeeeee">BINDEVENT(loForm, “SaveSuccessful”, ThisForm, “SaveAndRefresh”)</pre>
        <p>
With only an extra line or two of code you can get rid of the modal form and still
have your calling for get easily updated/refreshed when things are changed.
</p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=b5fe0773-5338-44b0-abc6-92e41f252101" />
      </body>
      <title>Alternative to Modal VFP Forms</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,b5fe0773-5338-44b0-abc6-92e41f252101.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2010/07/21/AlternativeToModalVFPForms.aspx</link>
      <pubDate>Wed, 21 Jul 2010 21:15:53 GMT</pubDate>
      <description>&lt;p&gt;
A common pattern you tend to find in maintenance forms is the ability to open another
form so you can add/edit/maintain some list of items. When you return back to the
calling form you want to refresh a combo or grid to reflect the changes. The way most
of us do this is to make the maintenance form modal. When you call it, code execution
stops until the form is released. That works but it can break down if you find yourself
more than 1 level deep in maintenance forms – the user can’t easily move windows out
of the way to see information and you’ll occasionally find that the wrong form has
somehow gotten focus leaving you stuck (unable to get focus back to the correct form). 
&lt;/p&gt;
&lt;p&gt;
Here’s an example. The user starts off on the Client Maintenance form, then clicks
on the Commissary button (military grocery store) to select which stores are associated
with this client. Then they click on the Commissary button again if they want to add/edit
a new store. When they close this form we want to refresh the second form.
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/AlternativetoModalVFPForms_A10D/image_3.png" width="640" height="448" /&gt; 
&lt;/p&gt;
&lt;p&gt;
Again, the normal way you might do this is to make the third form modal.
&lt;/p&gt;
&lt;pre style="background: #eeeeee"&gt;DO FORM CommissaryMaintenance
* When the form is closed the code below is run which saves and refreshes
* the options shown.
ThisForm.SaveAndRefresh()&lt;/pre&gt;
&lt;p&gt;
An alternative to this code (and making the form modal) is to do something like this
instead:
&lt;/p&gt;
&lt;pre style="background: #eeeeee"&gt;DO FORM CommissaryMaintenance NAME loForm
BINDEVENT(loForm, “Destroy”, ThisForm, “SaveAndRefresh”)&lt;/pre&gt;
&lt;p&gt;
Now the form can stay modeless. We’re taking advantage of VFP’s BINDEVENT command.
When the form is closed and the Destroy() event fired we’ll fire the SaveAndRefresh()
method which refreshes the form. It’s simple and avoids the problems mentioned above. 
&lt;/p&gt;
&lt;p&gt;
One suggestion is to add code in the calling form to set focus back to itself (in
case you are mixing and matching modal and non-modal forms). Ex. in the SaveAndRefresh()
method you might want to do something like this:
&lt;/p&gt;
&lt;pre style="background: #eeeeee"&gt;ThisForm.grdList.SetFocus()&lt;/pre&gt;
&lt;p&gt;
That will ensure that your form actually gets focus and back where the user is expecting
to be.
&lt;/p&gt;
&lt;p&gt;
This all works great, but what if you want to update the form as new items are add,
not just when the form closes? If you modify the maintenance form to call an empty
method after a successful save, ex. create a method named SaveSuccessful() you can
now bind to this method instead of Destroy().
&lt;/p&gt;
&lt;pre style="background: #eeeeee"&gt;BINDEVENT(loForm, “SaveSuccessful”, ThisForm, “SaveAndRefresh”)&lt;/pre&gt;
&lt;p&gt;
With only an extra line or two of code you can get rid of the modal form and still
have your calling for get easily updated/refreshed when things are changed.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=b5fe0773-5338-44b0-abc6-92e41f252101" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,b5fe0773-5338-44b0-abc6-92e41f252101.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=039366e3-976f-400e-9c23-ccbcae3c1254</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,039366e3-976f-400e-9c23-ccbcae3c1254.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,039366e3-976f-400e-9c23-ccbcae3c1254.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=039366e3-976f-400e-9c23-ccbcae3c1254</wfw:commentRss>
      <slash:comments>9</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <style type="text/css">
.code { background-color: #efefef; font-family:consolas,courier new; }
</style>
        <p>
I just <a href="http://www.rcs-solutions.com/downloads.aspx" target="_blank">posted</a> a
new release of my calendar controls that includes a bunch of new functionality, some
more documentation (courtesy of <a href="http://www.west-wind.com/wwHelp/" target="_blank">HTML
Help Builder</a> from West Wind), along with a few more samples of how this is all
supposed to work. 
</p>
        <p>
          <strong>A Bit of History </strong>
        </p>
        <p>
This all initially started with a small calendar. I initially planned on using Microsoft's
ActiveX calendar but realized I needed to be able to select multiple days. Their control
really didn't quite work the way I needed it to, so I created my own. I created three
different sizes (normal, smaller, and smallest) just because it was easy to do (they're
all the same control) and I thought I might need it. Like any project the "hey, wouldn't
it be cool if..." features started to grow. In some cases, I needed this functionality
for an application anyway, so I went ahead and improved them. 
</p>
        <p>
          <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="200" alt="Calendar" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendarControl_DF33/Calendar_3.png" width="215" border="0" />
        </p>
        <p>
The first thing I ended up needing was a drop-down calendar. I already had the calendar
portion, so all I needed to do was show and hide it when you clicked on a button next
to a text box. So that's basically what I did. It worked well enough, but if the control
happened to be at the bottom of a form it was clipped - the initial control was based
on a container. I moved this into a form and adjusted the code a bit so it would be
able to bleed off the form. 
</p>
        <p>
I needed to be able to bind to a date/time field but only display the date portion
for data coming from SQL Server, so I named it "rcsDatetimePicker". In hindsight,
not a great name. It gives you the impression it lets you view/edit both the date
and time portion when in fact it doesn't. At this point I've got a bunch of code which
depends on it so it's not being renamed (sorry). 
</p>
        <p>
          <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="223" alt="DatePicker" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendarControl_DF33/DatePicker_3.png" width="218" border="0" />
        </p>
        <p>
A common use-case for dropdown calendars is to pick a date range. I took an idea from
a previous job where you could link two date controls to keep the start date and the
end dates from overlapping (ex. the start date can be after the end date). So this
was added. 
</p>
        <p>
I worked on another project which needed a time control (hours/minutes) so I created
one. It seemed like a natural fit to this calendar library so it's been added in.
The next logical idea is, "hey, I need a date/time dropdown calendar". The better
name for this was already taken, so this was was named rcsCtrDateTimePicker. Yeah,
not great, but I didn't have any other ideas. 
</p>
        <p>
          <a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendarControl_DF33/DateTimePicker_2.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="228" alt="DateTimePicker" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendarControl_DF33/DateTimePicker_thumb.png" width="285" border="0" />
          </a>
        </p>
        <p>
Finally, I just worked on an application which needed an Outlook-style calendar (month
view). It seemed like I already had most of the work done from my other calendar,
so (I optimistically though) it wouldn't be a big deal to re-purpose it. It actually
required a number of changes so it could be nicely resized, display events, etc. 
</p>
        <p>
That's basically where the library is today: 3 different sized "static" calendars,
a drop-down date w/calendar, a drop-down date/time w/calendar, a time control, plus
a large resizable calendar that can have events displayed on it. 
</p>
        <p>
          <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="449" alt="LargeCalendar" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendarControl_DF33/LargeCalendar_3.png" width="501" border="0" />
        </p>
        <p>
          <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="469" alt="LargeCalendarMoreEvents" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendarControl_DF33/LargeCalendarMoreEvents_3.png" width="551" border="0" />
        </p>
        <p>
I've tried to provide a few more examples of how these controls can be used along
with a help file. It's not as comprehensive as I'd like, but it's a decent start. 
</p>
        <p>
          <strong>Misc. Notes</strong>
        </p>
        <p>
One thing that's not really covered in the help yet is related to performance of the
large calendar when you have a lot of events on it. I ran into this during testing
- as you add more events, the calendar navigation became slower and slower. I attempted
to optimize this a bit but ultimately ended up modifying my application code to only
populate events for the current month plus one month prior and one month following.
The calendar shows days from the previous and following months, so if I didn't populate
them they'd be missing from the calendar. 
</p>
        <p>
You can hook in populating events via the RefreshEvents() event. It fires anytime
the calendar needs to be refreshed. I'd suggest just using BINDEVENT to call a form-level
method for this event: 
</p>
        <div class="code">
          <p>
BINDEVENT(This.ctrCalendar, "RefreshEvents", This, "RefreshEvents")  
</p>
        </div>
        <p>
You can determine the current month by looking at the iCurrentYear/iCurrentMonth properties. 
</p>
        <p>
          <strong>Getting Started</strong>
        </p>
        <p>
I'd suggest playing around with the samples and digging through the help file to get
started. The examples cover most of the basic functionality (try clicking on everything
and hovering over things, resizing, etc.) and the help file explains some of the class
structure. 
</p>
        <p>
Let me know what you think. 
</p>
        <p>
          <strong>Links</strong>
        </p>
        <p>
          <a title="http://www.west-wind.com/wwHelp/" href="http://www.west-wind.com/wwHelp/">http://www.west-wind.com/wwHelp/</a>
          <br />
          <a href="http://www.rcs-solutions.com/downloads.aspx">http://www.rcs-solutions.com/downloads.aspx</a>
        </p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=039366e3-976f-400e-9c23-ccbcae3c1254" />
      </body>
      <title>Updated VFP Calendar Control</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,039366e3-976f-400e-9c23-ccbcae3c1254.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2009/02/21/UpdatedVFPCalendarControl.aspx</link>
      <pubDate>Sat, 21 Feb 2009 22:36:05 GMT</pubDate>
      <description> &lt;style type="text/css"&gt;
.code { background-color: #efefef; font-family:consolas,courier new; }
&lt;/style&gt;
&lt;p&gt;
I just &lt;a href="http://www.rcs-solutions.com/downloads.aspx" target="_blank"&gt;posted&lt;/a&gt; a
new release of my calendar controls that includes a bunch of new functionality, some
more documentation (courtesy of &lt;a href="http://www.west-wind.com/wwHelp/" target="_blank"&gt;HTML
Help Builder&lt;/a&gt; from West Wind), along with a few more samples of how this is all
supposed to work. 
&lt;p&gt;
&lt;strong&gt;A Bit of History &lt;/strong&gt; 
&lt;p&gt;
This all initially started with a small calendar. I initially planned on using Microsoft's
ActiveX calendar but realized I needed to be able to select multiple days. Their control
really didn't quite work the way I needed it to, so I created my own. I created three
different sizes (normal, smaller, and smallest) just because it was easy to do (they're
all the same control) and I thought I might need it. Like any project the "hey, wouldn't
it be cool if..." features started to grow. In some cases, I needed this functionality
for an application anyway, so I went ahead and improved them. 
&lt;p&gt;
&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="200" alt="Calendar" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendarControl_DF33/Calendar_3.png" width="215" border="0"&gt; 
&lt;p&gt;
The first thing I ended up needing was a drop-down calendar. I already had the calendar
portion, so all I needed to do was show and hide it when you clicked on a button next
to a text box. So that's basically what I did. It worked well enough, but if the control
happened to be at the bottom of a form it was clipped - the initial control was based
on a container. I moved this into a form and adjusted the code a bit so it would be
able to bleed off the form. 
&lt;p&gt;
I needed to be able to bind to a date/time field but only display the date portion
for data coming from SQL Server, so I named it "rcsDatetimePicker". In hindsight,
not a great name. It gives you the impression it lets you view/edit both the date
and time portion when in fact it doesn't. At this point I've got a bunch of code which
depends on it so it's not being renamed (sorry). 
&lt;p&gt;
&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="223" alt="DatePicker" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendarControl_DF33/DatePicker_3.png" width="218" border="0"&gt; 
&lt;p&gt;
A common use-case for dropdown calendars is to pick a date range. I took an idea from
a previous job where you could link two date controls to keep the start date and the
end dates from overlapping (ex. the start date can be after the end date). So this
was added. 
&lt;p&gt;
I worked on another project which needed a time control (hours/minutes) so I created
one. It seemed like a natural fit to this calendar library so it's been added in.
The next logical idea is, "hey, I need a date/time dropdown calendar". The better
name for this was already taken, so this was was named rcsCtrDateTimePicker. Yeah,
not great, but I didn't have any other ideas. 
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendarControl_DF33/DateTimePicker_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="228" alt="DateTimePicker" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendarControl_DF33/DateTimePicker_thumb.png" width="285" border="0"&gt;&lt;/a&gt; 
&lt;p&gt;
Finally, I just worked on an application which needed an Outlook-style calendar (month
view). It seemed like I already had most of the work done from my other calendar,
so (I optimistically though) it wouldn't be a big deal to re-purpose it. It actually
required a number of changes so it could be nicely resized, display events, etc. 
&lt;p&gt;
That's basically where the library is today: 3 different sized "static" calendars,
a drop-down date w/calendar, a drop-down date/time w/calendar, a time control, plus
a large resizable calendar that can have events displayed on it. 
&lt;p&gt;
&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="449" alt="LargeCalendar" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendarControl_DF33/LargeCalendar_3.png" width="501" border="0"&gt; 
&lt;p&gt;
&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="469" alt="LargeCalendarMoreEvents" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendarControl_DF33/LargeCalendarMoreEvents_3.png" width="551" border="0"&gt; 
&lt;p&gt;
I've tried to provide a few more examples of how these controls can be used along
with a help file. It's not as comprehensive as I'd like, but it's a decent start. 
&lt;p&gt;
&lt;strong&gt;Misc. Notes&lt;/strong&gt; 
&lt;p&gt;
One thing that's not really covered in the help yet is related to performance of the
large calendar when you have a lot of events on it. I ran into this during testing
- as you add more events, the calendar navigation became slower and slower. I attempted
to optimize this a bit but ultimately ended up modifying my application code to only
populate events for the current month plus one month prior and one month following.
The calendar shows days from the previous and following months, so if I didn't populate
them they'd be missing from the calendar. 
&lt;p&gt;
You can hook in populating events via the RefreshEvents() event. It fires anytime
the calendar needs to be refreshed. I'd suggest just using BINDEVENT to call a form-level
method for this event: 
&lt;div class="code"&gt;
&lt;p&gt;
BINDEVENT(This.ctrCalendar, "RefreshEvents", This, "RefreshEvents")&amp;nbsp; 
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;
You can determine the current month by looking at the iCurrentYear/iCurrentMonth properties. 
&lt;p&gt;
&lt;strong&gt;Getting Started&lt;/strong&gt; 
&lt;p&gt;
I'd suggest playing around with the samples and digging through the help file to get
started. The examples cover most of the basic functionality (try clicking on everything
and hovering over things, resizing, etc.) and the help file explains some of the class
structure. 
&lt;p&gt;
Let me know what you think. 
&lt;p&gt;
&lt;strong&gt;Links&lt;/strong&gt; 
&lt;p&gt;
&lt;a title="http://www.west-wind.com/wwHelp/" href="http://www.west-wind.com/wwHelp/"&gt;http://www.west-wind.com/wwHelp/&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://www.rcs-solutions.com/downloads.aspx"&gt;http://www.rcs-solutions.com/downloads.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=039366e3-976f-400e-9c23-ccbcae3c1254" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,039366e3-976f-400e-9c23-ccbcae3c1254.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=59a0896c-b088-4a52-9695-6cea7d536ad8</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,59a0896c-b088-4a52-9695-6cea7d536ad8.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,59a0896c-b088-4a52-9695-6cea7d536ad8.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=59a0896c-b088-4a52-9695-6cea7d536ad8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I mentioned a number of <a href="http://www.rcs-solutions.com/blog/2007/10/30/IntellisenseAndBuilders.aspx" target="_blank">default
Intellisense scripts</a> I normally set-up in VFP a while back. Since I just set VFP
9 back up on my Vista 64 machine I've been living without them for a while - I was
too lazy to follow my own post and add them back in. It's been making me crazy tonight
while I try to get some code written so I finally just wrote a quick PRG to add them
in (so next time it's even more painless).
</p>
        <p>
It's not particularly smart so don't run it more than once, it will duplicate them.
</p>
        <p>
          <a href="http://www.rcs-solutions.com/Download.ashx?File=AddIntellisense.prg" target="_blank">Download
the Intellisense PRG.</a>
        </p>
        <p>
          <font color="#0000ff">Edit: </font>
          <strike>Hmm...It looks like my download code isn't
setting the correct filetype when you download it (it's saving as a "HTM" file when
it's actually a PRG). Just rename it and I'll fix the download code at some point.</strike> This
should be fixed.
</p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=59a0896c-b088-4a52-9695-6cea7d536ad8" />
      </body>
      <title>VFP Intellisense</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,59a0896c-b088-4a52-9695-6cea7d536ad8.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2008/10/22/VFPIntellisense.aspx</link>
      <pubDate>Wed, 22 Oct 2008 01:48:50 GMT</pubDate>
      <description>&lt;p&gt;
I mentioned a number of &lt;a href="http://www.rcs-solutions.com/blog/2007/10/30/IntellisenseAndBuilders.aspx" target="_blank"&gt;default
Intellisense scripts&lt;/a&gt; I normally set-up in VFP a while back. Since I just set VFP
9 back up on my Vista 64 machine I've been living without them for a while - I was
too lazy to follow my own post and add them back in. It's been making me crazy tonight
while I try to get some code written so I finally just wrote a quick PRG to add them
in (so next time it's even more painless).
&lt;/p&gt;
&lt;p&gt;
It's not particularly smart so don't run it more than once, it will duplicate them.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/Download.ashx?File=AddIntellisense.prg" target="_blank"&gt;Download
the Intellisense PRG.&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color="#0000ff"&gt;Edit: &lt;/font&gt;&lt;strike&gt;Hmm...It looks like my download code isn't
setting the correct filetype when you download it (it's saving as a "HTM" file when
it's actually a PRG). Just rename it and I'll fix the download code at some point.&lt;/strike&gt; This
should be fixed.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=59a0896c-b088-4a52-9695-6cea7d536ad8" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,59a0896c-b088-4a52-9695-6cea7d536ad8.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=edf4986a-03be-4306-9968-0841dd50b084</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,edf4986a-03be-4306-9968-0841dd50b084.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,edf4986a-03be-4306-9968-0841dd50b084.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=edf4986a-03be-4306-9968-0841dd50b084</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
One of the things missing from the GridSort control I posted about <a href="http://www.rcs-solutions.com/blog/2008/07/31/SortingTheVFPGrid.aspx">while
back</a> was a sample of how it's used. I was thinking of just including a sample
form, but I decided to just walk through the steps of using it instead. Let's start
off by creating a new form. Next, we'll drop a grid control onto the form and name
it "grdSample". Now we need some data to fill in the form - let's use one of the sample
tables included in VFP - Customer. Right-click on the form and edit the data environment.
Click on Other and navigate to C:\Program Files\Microsoft Visual FoxPro 9\Samples\Data\
and select "Customer.dbf". Now close the data environment. Run the form. 
</p>
        <p>
I ended up stretching the grid out a bit to show more of the information and anchoring
it so that if I stretched the form the grid would resize. Now we're going to add the
rcsGridSort control to the form - I like to just use the class browser to open the
class up, click on "gridsort" and then drag and drop the "shape" icon in the upper
left hand side of the window onto the form. In the property sheet we're going to need
to fill in the cGridEval property of the gridsort control. Enter: ThisForm.grdSample.
Now run the form again. 
</p>
        <p>
Double-click on the various column headers: an arrow should appear and the column
should be sorted. Double-click on the same column and the sort order will flip (if
it was ascending it will change to descending or vice-versa). If the images are missing
it's because VFP isn't finding them; either add the images to your path or include
them in current directory. Or, you can set the pathing in the cSortAscendingGraphic/cSortDescendingGraphic
properties of the control. 
</p>
        <p>
          <a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/881a4bfc849e_10EBF/gs_2.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="340" alt="gs" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/881a4bfc849e_10EBF/gs_thumb.png" width="605" border="0" />
          </a>
        </p>
        <p>
Like I mentioned in my original post, this control uses the BINDEVENT command which
I think was introduced in VFP 8. Therefore, the control requires VFP 8 or later. 
</p>
        <p>
          <strong>Links:</strong>
        </p>
        <p>
          <a href="http://www.rcs-solutions.com/blog/2008/07/31/SortingTheVFPGrid.aspx">http://www.rcs-solutions.com/blog/2008/07/31/SortingTheVFPGrid.aspx</a>
          <br />
          <a title="http://www.rcs-solutions.com/downloads.aspx" href="http://www.rcs-solutions.com/downloads.aspx">http://www.rcs-solutions.com/downloads.aspx</a>
        </p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=edf4986a-03be-4306-9968-0841dd50b084" />
      </body>
      <title>Grid Sort Sample</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,edf4986a-03be-4306-9968-0841dd50b084.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2008/09/25/GridSortSample.aspx</link>
      <pubDate>Thu, 25 Sep 2008 22:51:32 GMT</pubDate>
      <description>&lt;p&gt;
One of the things missing from the GridSort control I posted about &lt;a href="http://www.rcs-solutions.com/blog/2008/07/31/SortingTheVFPGrid.aspx"&gt;while
back&lt;/a&gt; was a sample of how it's used. I was thinking of just including a sample
form, but I decided to just walk through the steps of using it instead. Let's start
off by creating a new form. Next, we'll drop a grid control onto the form and name
it "grdSample". Now we need some data to fill in the form - let's use one of the sample
tables included in VFP - Customer. Right-click on the form and edit the data environment.
Click on Other and navigate to C:\Program Files\Microsoft Visual FoxPro 9\Samples\Data\
and select "Customer.dbf". Now close the data environment. Run the form. 
&lt;/p&gt;
&lt;p&gt;
I ended up stretching the grid out a bit to show more of the information and anchoring
it so that if I stretched the form the grid would resize. Now we're going to add the
rcsGridSort control to the form - I like to just use the class browser to open the
class up, click on "gridsort" and then drag and drop the "shape" icon in the upper
left hand side of the window onto the form. In the property sheet we're going to need
to fill in the cGridEval property of the gridsort control. Enter: ThisForm.grdSample.
Now run the form again. 
&lt;/p&gt;
&lt;p&gt;
Double-click on the various column headers: an arrow should appear and the column
should be sorted. Double-click on the same column and the sort order will flip (if
it was ascending it will change to descending or vice-versa). If the images are missing
it's because VFP isn't finding them; either add the images to your path or include
them in current directory. Or, you can set the pathing in the cSortAscendingGraphic/cSortDescendingGraphic
properties of the control. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/881a4bfc849e_10EBF/gs_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="340" alt="gs" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/881a4bfc849e_10EBF/gs_thumb.png" width="605" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Like I mentioned in my original post, this control uses the BINDEVENT command which
I think was introduced in VFP 8. Therefore, the control requires VFP 8 or later. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/blog/2008/07/31/SortingTheVFPGrid.aspx"&gt;http://www.rcs-solutions.com/blog/2008/07/31/SortingTheVFPGrid.aspx&lt;/a&gt;
&lt;br&gt;
&lt;a title="http://www.rcs-solutions.com/downloads.aspx" href="http://www.rcs-solutions.com/downloads.aspx"&gt;http://www.rcs-solutions.com/downloads.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=edf4986a-03be-4306-9968-0841dd50b084" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,edf4986a-03be-4306-9968-0841dd50b084.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=260451da-7a8f-46d4-bee5-b3dba26fd239</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,260451da-7a8f-46d4-bee5-b3dba26fd239.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,260451da-7a8f-46d4-bee5-b3dba26fd239.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=260451da-7a8f-46d4-bee5-b3dba26fd239</wfw:commentRss>
      <slash:comments>7</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've been using a "common" style for my reports for quite a while. I include a report
title, then below that I usually have one or more lines which show which filter and
sorting criteria were used to generate the report. I include a page X/Y line, usually
in the bottom right hand side of the report. At some point I started adding the print
date/time, who it was printed by, and the name of the file of the report. All of these
fields together have been valuable when making changes and in determining why something
isn't working. 
</p>
        <p>
The other day I had someone bring a report that was generated last year for the first
6 months of 2007 by an employee who is no longer with the company. They were attempting
to tie the summarized numbers back to the detail which generated them and weren't
sure how to find the detail. We had recently changed a fundamental aspect of how this
particular report and supporting (detail) reports generated some of their numbers
so I decided to just run a query against the database to get the information they
were looking for. I looked at the timeframe the report was run for and wrote the query
- there were no filters so it was really straightforward, or so I thought. When I
totaled up the numbers they didn't match the report. Uh oh. I started worrying about
what kinds of bad things might have happened that would have changed our historical
tables. 
</p>
        <p>
Ugh...Then I noticed that the report was printed on the ending date of the report
(in this case, it was run for 1/1/2007 - 6/28/2007) and it was printed on 6/28/2007.
The light bulb went on. This particular report showed numbers that weren't available
until a few months after the month they were applicable to. Essentially, we don't
get numbers for January until March (even though they are posted back into January).
So when this report was run, the numbers for April forward weren't available yet and
weren't included in the report (even though the report range said it was through 6/28/2007).
In the meantime those numbers had been posted and since I was pulling these numbers
a year later they appeared in my version. I adjusted my query to exclude numbers posted
after the report run date/time and suddenly everything balanced. Without knowing when
the report was run it would have taken a LOT of work to resolve this (I'm not even
sure I would have been able to). 
</p>
        <p>
Are there any types of things you're including on reports which have saved you? 
</p>
        <p>
In addition to the fields mentioned above, I've recently started including a "key"
at the bottom of a number of reports which explain how numbers are generated and a
more detailed explanation of their meaning. As questions come up about them I adjust
my descriptions so they answer the questions asked. I'm using a really tiny font to
keep the amount of space lost to them to a minimum but I'm finding they have also
been really valuable since I'm not having to refer to the code as much to explain
how some numbers were derived. It also addresses the issue where you use common names
for column headers on various reports but the underlying numbers in those columns
are actually inclusive or exclude different things. 
</p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=260451da-7a8f-46d4-bee5-b3dba26fd239" />
      </body>
      <title>Report Standards</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,260451da-7a8f-46d4-bee5-b3dba26fd239.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2008/08/16/ReportStandards.aspx</link>
      <pubDate>Sat, 16 Aug 2008 01:48:03 GMT</pubDate>
      <description>&lt;p&gt;
I've been using a "common" style for my reports for quite a while. I include a report
title, then below that I usually have one or more lines which show which filter and
sorting criteria were used to generate the report. I include a page X/Y line, usually
in the bottom right hand side of the report. At some point I started adding the print
date/time, who it was printed by, and the name of the file of the report. All of these
fields together have been valuable when making changes and in determining why something
isn't working. 
&lt;/p&gt;
&lt;p&gt;
The other day I had someone bring a report that was generated last year for the first
6 months of 2007 by an employee who is no longer with the company. They were attempting
to tie the summarized numbers back to the detail which generated them and weren't
sure how to find the detail. We had recently changed a fundamental aspect of how this
particular report and supporting (detail) reports generated some of their numbers
so I decided to just run a query against the database to get the information they
were looking for. I looked at the timeframe the report was run for and wrote the query
- there were no filters so it was really straightforward, or so I thought. When I
totaled up the numbers they didn't match the report. Uh oh. I started worrying about
what kinds of bad things might have happened that would have changed our historical
tables. 
&lt;/p&gt;
&lt;p&gt;
Ugh...Then I noticed that the report was printed on the ending date of the report
(in this case, it was run for 1/1/2007 - 6/28/2007) and it was printed on 6/28/2007.
The light bulb went on. This particular report showed numbers that weren't available
until a few months after the month they were applicable to. Essentially, we don't
get numbers for January until March (even though they are posted back into January).
So when this report was run, the numbers for April forward weren't available yet and
weren't included in the report (even though the report range said it was through 6/28/2007).
In the meantime those numbers had been posted and since I was pulling these numbers
a year later they appeared in my version. I adjusted my query to exclude numbers posted
after the report run date/time and suddenly everything balanced. Without knowing when
the report was run it would have taken a LOT of work to resolve this (I'm not even
sure I would have been able to). 
&lt;/p&gt;
&lt;p&gt;
Are there any types of things you're including on reports which have saved you? 
&lt;/p&gt;
&lt;p&gt;
In addition to the fields mentioned above, I've recently started including a "key"
at the bottom of a number of reports which explain how numbers are generated and a
more detailed explanation of their meaning. As questions come up about them I adjust
my descriptions so they answer the questions asked. I'm using a really tiny font to
keep the amount of space lost to them to a minimum but I'm finding they have also
been really valuable since I'm not having to refer to the code as much to explain
how some numbers were derived. It also addresses the issue where you use common names
for column headers on various reports but the underlying numbers in those columns
are actually inclusive or exclude different things. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=260451da-7a8f-46d4-bee5-b3dba26fd239" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,260451da-7a8f-46d4-bee5-b3dba26fd239.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=867b838c-c775-4fed-a27b-a7ef42206e36</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,867b838c-c775-4fed-a27b-a7ef42206e36.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,867b838c-c775-4fed-a27b-a7ef42206e36.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=867b838c-c775-4fed-a27b-a7ef42206e36</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I'm a big fan of "drop in" components which can add functionality to my applications
as opposed to what is more commonly thought of as framework-level code which bakes
in functionality. What do I mean by that? The common way of building in functionality
into an application (usually via a framework) is to develop an class hierarchy, then
inherit from those classes in your application as you build up functionality. A form
class may have code which remember it's location and size when you close it, an edit
box may add some spell checking ability, etc. If you inherit all your forms from these
classes they suddenly have all this extra functionality and life is good. Then, as
the framework is built you tend to end up with a number of interdependencies between
components, which suddenly makes it more difficult to be able to use these components
in other applications which don't include most of the framework libraries and inherit
from the proper classes. On one level that's fine, since it allows for a fairly high
level of functionlity and consistency. However, it requires a high level of "buy in"
in order to use even the most basic aspects of the framework. In many cases you just
can't use some cool combobox class from the framework in another application without
requiring the full framework (and inheritance chain) to come along for the ride, which
is a bit of a bummer. There are a huge number of applications written that can't easily
be integrated with a framework (as most VFP developers think of them). 
</p>
        <p>
What if, instead, components had been built to be highly modular - drop in a small
class library, add the control to your form and you're good to go. Until VFP 9 this
was actually a bit hard to do - what if your control needed to respond to various
form events? Everytime you dropped the control on a new form you suddenly have to
do a lot of wiring up by adding code to the various events your control was interested
in. Which leads back to the first style of development that just assumes you'll be
using these components as a whole. However, in VFP 8 they introduced a set of commands
to allow for event binding: BINDEVENT(), UNBINDEVENTS(), RAISEEVENT() and AEVENTS().
So what do these commands do and what do they give you? They give you a mechanism
of listening for specific events that fire on an object and handling those events
in your own code. You can do this without the "source" object even being aware you
are listening to it's events. 
</p>
        <p>
A real example might help: 
</p>
        <p>
Let's suppose we want to add the ability to sort a column in a grid. The common way
of doing that would be to create a subclass of a grid, add some code which does the
sorting as methods on the grid, then require the developer to "hook up" the functionality
during development so that this new functionality runs when a user double clicks on
the row header. In effect, add code to every column's header and adding code to the
DblClick() event. You'll even notice that even if we require you to use our new subclassed
grid the functionality still isn't really just drop-in seamless. So how can event
binding help here? Can it help us achieve both goals of not requiring any glue code
and not requiring us to inherit from a specific grid control? 
</p>
        <p>
What I'd love to end up with is a control I can drop on a form, point it to some grid
control and have the grid "magically" let you sort without requiring a lot of changes
to existing code. So let's start from that premise and create a custom control. I'll
add cGridEval property which can be filled in with a string which is EVAL'd at runtime
to resolve a live object reference to our grid, ex. you can fill in something like
"This.grdSample". That's the easy part, now how do we use event binding to let us
do everything else? 
</p>
        <p>
I'm going to create a BindControl() method in my custom control and we'll first get
our object reference to the grid: 
</p>
        <p>
          <font face="Courier New">loGrid = EVALULATE(This.cGridEval)</font>
        </p>
        <p>
Every grid has a Columns collection that we can iterate through and each column has
a Controls collection. If we take a look at the BaseClass property of the controls
here we can determine which one is the Header column. At that point we can use BINDEVENT()
to hook up the DblClick() event to us - when a user double clicks on this grid column
the event will fire on the grid and we'll also get a notification that the event has
fired. 
</p>
        <h6>
          <font face="Courier New" size="2">FOR EACH loColumn IN loGrid.Columns<br /></font>
          <font size="+0">
            <font face="Courier New">
              <font size="2">   
FOR EACH loControl IN loColumn.Controls<br />
        IF loControl.BaseClass = "Header"<br />
           BINDEVENT(loControl,
"DblClick", This, "Sort")<br />
           EXIT<br />
        ENDIF<br />
    ENDFOR<br /><font size="+0">ENDFOR</font></font>
            </font>
          </font>
        </h6>
        <p>
The BINDEVENT() function is where the real work happens. We pass the control we want
to listen to as the first parameter, in this case the header. Then we pass (as a string)
the name of the method we want to listen to, "DblClick". The third parameter is an
object reference to the subscribing object (us), and the fourth is the method VFP
should call on our object. You must make sure that the method you create on your subscriber
accepts all of the same parameters as the event being fired. For example, if we hooked
into the KeyPress event accepts two parameters, nKeyCode and nShiftAltCtrl - you have
to accept the same parameters in your subscribing method. There is a fifth parameter
which can be passed that we're not using which allows you to specify when your code
is called - before or after the original control's method fires. DblClick doesn't
pass in any parameters, so we're good. All we need to do is create a "Sort" method
on our custom object. 
</p>
        <p>
At this point, when a user double clicks on a header in a hooked up grid, our Sort
event fires. Great - now how do we figure out which header was clicked on? Here's
where the AEVENTS() function comes into play - it fills an array with information
about the object that triggered the event. We can use this information to get a reference
to the actual header the user double clicked on. From there, we can determine which
column in the grid to sort. 
</p>
        <p>
          <font face="Courier New" size="2">AEVENTS(laEvent, 0)</font>
        </p>
        <p>
This gives us a 3 column array, laEvent: 
</p>
        <p>
laEvent[1] - An object reference to the header that was clicked<br />
laEvent[2] - The event that was fired<br />
laEvent[3] - The event type (how the event was raised). 
</p>
        <p>
In our case we're really only interested in laEvent[1]. Once we have our header reference
we can get the column's control source like this: 
</p>
        <p>
          <font face="Courier New" size="2">loHeader = laEvent[1]<br />
loColumn = loHeader.Parent<br />
lcControlSource = ALLTRIM(loColumn.ControlSource)</font>
        </p>
        <p>
All that's left is for us to build up a way of creating temporarily indexes and maintaining
a list of which indexes have been created (and whether we're current ascending or
descending). One thing that is kind of nice is that since we now have a reference
to the column header, we can also do things like add some graphical image to the sorted
column to make it easy for the user to see which column has been sorted and in which
direction. 
</p>
        <p>
You'll notice that I didn't cover the UNBINDEVENTS() and RAISEEVENT() functions. UNBINDEVENTS
does just what you'd expect - it unhooks an event handler so that it no longer receives
the bound event. RAISEVENT() lets you "fire" an event (both things like custom events
and events on native VFP objects). I don't have a nice example of this so I'll leave
that for some other time. 
</p>
        <p>
You can download the finished control below. 
</p>
        <p>
          <strong>Links:</strong>
        </p>
        <p>
          <strong>
            <a href="http://www.rcs-solutions.com/Download.ashx?File=rcsGridSort.zip">http://www.rcs-solutions.com/Download.ashx?File=rcsGridSort.zip</a>
          </strong>
          <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=867b838c-c775-4fed-a27b-a7ef42206e36" />
        </p>
      </body>
      <title>Sorting the VFP Grid</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,867b838c-c775-4fed-a27b-a7ef42206e36.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2008/07/31/SortingTheVFPGrid.aspx</link>
      <pubDate>Thu, 31 Jul 2008 23:00:22 GMT</pubDate>
      <description>&lt;p&gt;
I'm a big fan of "drop in" components which can add functionality to my applications
as opposed to what is more commonly thought of as framework-level code which bakes
in functionality. What do I mean by that? The common way of building in functionality
into an application (usually via a framework) is to develop an class hierarchy, then
inherit from those classes in your application as you build up functionality. A form
class may have code which remember it's location and size when you close it, an edit
box may add some spell checking ability, etc. If you inherit all your forms from these
classes they suddenly have all this extra functionality and life is good. Then, as
the framework is built you tend to end up with a number of interdependencies between
components, which suddenly makes it more difficult to be able to use these components
in other applications which don't include most of the framework libraries and inherit
from the proper classes. On one level that's fine, since it allows for a fairly high
level of functionlity and consistency. However, it requires a high level of "buy in"
in order to use even the most basic aspects of the framework. In many cases you just
can't use some cool combobox class from the framework in another application without
requiring the full framework (and inheritance chain) to come along for the ride, which
is a bit of a bummer. There are a huge number of applications written that can't easily
be integrated with a framework (as most VFP developers think of them). 
&lt;/p&gt;
&lt;p&gt;
What if, instead, components had been built to be highly modular - drop in a small
class library, add the control to your form and you're good to go. Until VFP 9 this
was actually a bit hard to do - what if your control needed to respond to various
form events? Everytime you dropped the control on a new form you suddenly have to
do a lot of wiring up by adding code to the various events your control was interested
in. Which leads back to the first style of development that just assumes you'll be
using these components as a whole. However, in VFP 8 they introduced a set of commands
to allow for event binding: BINDEVENT(), UNBINDEVENTS(), RAISEEVENT() and AEVENTS().
So what do these commands do and what do they give you? They give you a mechanism
of listening for specific events that fire on an object and handling those events
in your own code. You can do this without the "source" object even being aware you
are listening to it's events. 
&lt;/p&gt;
&lt;p&gt;
A real example might help: 
&lt;/p&gt;
&lt;p&gt;
Let's suppose we want to add the ability to sort a column in a grid. The common way
of doing that would be to create a subclass of a grid, add some code which does the
sorting as methods on the grid, then require the developer to "hook up" the functionality
during development so that this new functionality runs when a user double clicks on
the row header. In effect, add code to every column's header and adding code to the
DblClick() event. You'll even notice that even if we require you to use our new subclassed
grid the functionality still isn't really just drop-in seamless. So how can event
binding help here? Can it help us achieve both goals of not requiring any glue code
and not requiring us to inherit from a specific grid control? 
&lt;/p&gt;
&lt;p&gt;
What I'd love to end up with is a control I can drop on a form, point it to some grid
control and have the grid "magically" let you sort without requiring a lot of changes
to existing code. So let's start from that premise and create a custom control. I'll
add cGridEval property which can be filled in with a string which is EVAL'd at runtime
to resolve a live object reference to our grid, ex. you can fill in something like
"This.grdSample". That's the easy part, now how do we use event binding to let us
do everything else? 
&lt;/p&gt;
&lt;p&gt;
I'm going to create a BindControl() method in my custom control and we'll first get
our object reference to the grid: 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;loGrid = EVALULATE(This.cGridEval)&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
Every grid has a Columns collection that we can iterate through and each column has
a Controls collection. If we take a look at the BaseClass property of the controls
here we can determine which one is the Header column. At that point we can use BINDEVENT()
to hook up the DblClick() event to us - when a user double clicks on this grid column
the event will fire on the grid and we'll also get a notification that the event has
fired. 
&lt;h6&gt;&lt;font face="Courier New" size="2"&gt;FOR EACH loColumn IN loGrid.Columns&lt;br&gt;
&lt;/font&gt;&lt;font size="+0"&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
FOR EACH loControl IN loColumn.Controls&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF loControl.BaseClass = "Header"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BINDEVENT(loControl,
"DblClick", This, "Sort")&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXIT&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDFOR&lt;br&gt;
&lt;font size="+0"&gt;ENDFOR&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;
&lt;/h6&gt;
&gt; 
&lt;p&gt;
The BINDEVENT() function is where the real work happens. We pass the control we want
to listen to as the first parameter, in this case the header. Then we pass (as a string)
the name of the method we want to listen to, "DblClick". The third parameter is an
object reference to the subscribing object (us), and the fourth is the method VFP
should call on our object. You must make sure that the method you create on your subscriber
accepts all of the same parameters as the event being fired. For example, if we hooked
into the KeyPress event accepts two parameters, nKeyCode and nShiftAltCtrl - you have
to accept the same parameters in your subscribing method. There is a fifth parameter
which can be passed that we're not using which allows you to specify when your code
is called - before or after the original control's method fires. DblClick doesn't
pass in any parameters, so we're good. All we need to do is create a "Sort" method
on our custom object. 
&lt;/p&gt;
&lt;p&gt;
At this point, when a user double clicks on a header in a hooked up grid, our Sort
event fires. Great - now how do we figure out which header was clicked on? Here's
where the AEVENTS() function comes into play - it fills an array with information
about the object that triggered the event. We can use this information to get a reference
to the actual header the user double clicked on. From there, we can determine which
column in the grid to sort. 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" size="2"&gt;AEVENTS(laEvent, 0)&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
This gives us a 3 column array, laEvent: 
&lt;/p&gt;
&lt;p&gt;
laEvent[1] - An object reference to the header that was clicked&lt;br&gt;
laEvent[2] - The event that was fired&lt;br&gt;
laEvent[3] - The event type (how the event was raised). 
&lt;/p&gt;
&lt;p&gt;
In our case we're really only interested in laEvent[1]. Once we have our header reference
we can get the column's control source like this: 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" size="2"&gt;loHeader = laEvent[1]&lt;br&gt;
loColumn = loHeader.Parent&lt;br&gt;
lcControlSource = ALLTRIM(loColumn.ControlSource)&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
All that's left is for us to build up a way of creating temporarily indexes and maintaining
a list of which indexes have been created (and whether we're current ascending or
descending). One thing that is kind of nice is that since we now have a reference
to the column header, we can also do things like add some graphical image to the sorted
column to make it easy for the user to see which column has been sorted and in which
direction. 
&lt;/p&gt;
&lt;p&gt;
You'll notice that I didn't cover the UNBINDEVENTS() and RAISEEVENT() functions. UNBINDEVENTS
does just what you'd expect - it unhooks an event handler so that it no longer receives
the bound event. RAISEVENT() lets you "fire" an event (both things like custom events
and events on native VFP objects). I don't have a nice example of this so I'll leave
that for some other time. 
&lt;/p&gt;
&lt;p&gt;
You can download the finished control below. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links:&lt;/strong&gt; 
&lt;p&gt;
&lt;strong&gt;&lt;a href="http://www.rcs-solutions.com/Download.ashx?File=rcsGridSort.zip"&gt;http://www.rcs-solutions.com/Download.ashx?File=rcsGridSort.zip&lt;/a&gt;&lt;/strong&gt;&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=867b838c-c775-4fed-a27b-a7ef42206e36" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,867b838c-c775-4fed-a27b-a7ef42206e36.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=f209f8c4-6087-41cb-b876-ff349f42e8e2</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,f209f8c4-6087-41cb-b876-ff349f42e8e2.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,f209f8c4-6087-41cb-b876-ff349f42e8e2.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=f209f8c4-6087-41cb-b876-ff349f42e8e2</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I mentioned Dependency Injection / Inversion of Control (DI/IoC) recently and I really
didn't explain what it is, why you might want to use this particular pattern, and
why on earth you'd need a framework for it. It's a fancy name for a fairly simple
concept. Instead of creating objects inside of your classes, you let the calling code
"inject" the necessary instances into your code. It's probably easiest to see this
in some code. I'm going to show both C# and VFP code, since I don't want you to get
the idea that this is a .NET-only type thing. 
<br />
 
</p>
        <div style="font-size: 10pt; background: white; color: black; font-family: consolas, courier new">
          <p style="margin: 0px">
            <span style="color: #2b91af">   1</span> <span style="color: blue">public</span><span style="color: blue">class</span><span style="color: #2b91af">SampleDependency</span></p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   2</span> {
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   3</span>    <span style="color: blue">public</span><span style="color: blue">string</span> SayHello()
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   4</span>    {
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   5</span>       <span style="color: blue">return</span><span style="background: #e5e5e5">"Hello"</span>;
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   6</span>    }
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   7</span> }
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   8</span> 
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   9</span> <span style="color: blue">public</span><span style="color: blue">class</span><span style="color: #2b91af">Sample</span></p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   10</span> {
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   11</span>    <span style="color: blue">protected</span><span style="color: #2b91af">SampleDependency</span> m_depend;
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   12</span> 
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   13</span>    <span style="color: blue">public</span><span style="color: #2b91af">SampleDependency</span> Depend
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   14</span>    {
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   15</span>       <span style="color: blue">set</span> { <span style="color: blue">this</span>.m_depend
= <span style="color: blue">value</span>; }
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   16</span>    }
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   17</span> 
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   18</span>    <span style="color: blue">public</span> Sample(<span style="color: #2b91af">SampleDependency</span> depend)
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   19</span>    {
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   20</span>      
m_depend = depend;
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   21</span>    }
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">   22</span> }
</p>
          <p style="margin: 0px">
 
</p>
        </div>
        <div style="font-size: 10pt; background: white; color: black; font-family: consolas, courier new">
          <p style="margin: 0px">
            <span style="color: #2b91af">  </span>    <span style="color: #2b91af">Sample</span> sample
= <span style="color: blue">new</span><span style="color: #2b91af">Sample</span>(<span style="color: blue">new</span><span style="color: #2b91af">SampleDependency</span>());
</p>
          <p style="margin: 0px">
 
</p>
        </div>
        <b>VFP Version</b>
        <pre style="background: #eeeeee">DEFINE CLASS SampleDependency AS Session 
   FUNCTION SayHello() 
      RETURN "Hello" 
   ENDFUNC 
ENDDEFINE 

DEFINE CLASS Sample AS Session 
   oDepend = NULL 
   FUNCTION Init(toDepend) 
      This.oDepend = toDepend 
   ENDFUNC 
ENDDEFINE 

loSample = CREATEOBJECT("Sample", CREATEOBJECT("SampleDependency"))</pre>
        <pre>
        </pre>
        <p>
Notice that in both cases, we are passing in the instance we want the class to use
instead of letting the class create the instance itself. That's all DI/IoC is. Honest,
that's it. This is DI via a constructor (you can also do it via a property setting
instead; notice in the sample C# code I created a write-only property which could
hold the reference). 
</p>
        <p>
So the next obvious question is, why? What's wrong with just creating the object inside
of the class? 
</p>
        <p>
One thing DI gives you is the ability to easily swap in different objects. In the
C# example, we probably would change the parameter from a specific type to an interface.
Now any class which implements that interface can be injected into this class. In
VFP, since it's not strongly typed, you can just pass in whatever instance you'd like
(it's up to you to make sure it doesn't blow up at runtime by accessing some method
or property which isn't on the passed in object). My initial thought after seeing
this was, well, can't I just use an abstract factory pattern instead? In an abstract
factory you delegate object creation to a "object factory" - usually passing in a
name or calling a method which returns the actual instance you'd like to use. This
sounds like almost the same thing. 
</p>
        <p>
An abstract factory does let you do that, but it doesn't let you easily do something
the DI/IoC pattern does: test your objects. Let's suppose you want to write a test
for a class which uses another class to send out an e-mail. You aren't really trying
to test sending an e-mail - that's just one of the things the class you're testing
happens to do during some process. In fact, you really don't want to send out an e-mail;
we don't want to spam our users. If you happen to use the abstract factory pattern,
you would need to modify it to create your <a href="http://weblogs.asp.net/rosherove/archive/2007/09/16/mocks-and-stubs-the-difference-is-in-the-flow-of-information.aspx" target="_blank">dummy/stub/mock</a> object
for sending an e-mail (in VFP that's most likely by editing a record in a table, but
the idea is the same), then test the object in question. If you used the DI/IoC pattern
the only thing you need to do is pass in your dummy/stub/mock object. No other modifications
are necessary. 
</p>
        <p>
OK, so this all looks simple enough. Why would you need a framework for the above?!
One of the biggest reasons - less typing. You'll notice that in order to use any of
these objects you may have to pass in a bunch of other dependency objects (which themselves
may have other dependencies). For a complex set of objects that could really suck.
A DI framework does that for you along with the benefits of an abstract factory, all
rolled up into one. In your code you call the DI framework and tell it to get you
an instance of a class - it figures out what objects need to be passed in for you
so you don't need to do it. In your tests, you can instanciate the objects directly
and pass in your stub/dummy/mock objects instead. 
</p>
        <p>
          <strong>Links:</strong>
        </p>
        <p>
          <a href="http://weblogs.asp.net/rosherove/archive/2007/09/16/mocks-and-stubs-the-difference-is-in-the-flow-of-information.aspx">http://weblogs.asp.net/rosherove/archive/2007/09/16/mocks-and-stubs-the-difference-is-in-the-flow-of-information.aspx</a>
          <br />
          <a title="http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx" href="http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx">http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx</a>
        </p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=f209f8c4-6087-41cb-b876-ff349f42e8e2" />
      </body>
      <title>What is Dependency Injection?</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,f209f8c4-6087-41cb-b876-ff349f42e8e2.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2008/07/12/WhatIsDependencyInjection.aspx</link>
      <pubDate>Sat, 12 Jul 2008 14:34:13 GMT</pubDate>
      <description>&lt;p&gt;
I mentioned Dependency Injection / Inversion of Control (DI/IoC) recently and I really
didn't explain what it is, why you might want to use this particular pattern, and
why on earth you'd need a framework for it. It's a fancy name for a fairly simple
concept. Instead of creating objects inside of your classes, you let the calling code
"inject" the necessary instances into your code. It's probably easiest to see this
in some code. I'm going to show both C# and VFP code, since I don't want you to get
the idea that this is a .NET-only type thing. 
&lt;br&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas, courier new"&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 1&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;SampleDependency&lt;/span&gt;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 2&lt;/span&gt; {
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 3&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; SayHello()
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 4&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 5&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="background: #e5e5e5"&gt;"Hello"&lt;/span&gt;;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 6&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 7&lt;/span&gt; }
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 8&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 9&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Sample&lt;/span&gt;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 10&lt;/span&gt; {
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 11&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: #2b91af"&gt;SampleDependency&lt;/span&gt; m_depend;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 12&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 13&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;SampleDependency&lt;/span&gt; Depend
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 14&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 15&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;set&lt;/span&gt; { &lt;span style="color: blue"&gt;this&lt;/span&gt;.m_depend
= &lt;span style="color: blue"&gt;value&lt;/span&gt;; }
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 16&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 17&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 18&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt; Sample(&lt;span style="color: #2b91af"&gt;SampleDependency&lt;/span&gt; depend)
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 19&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 20&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
m_depend = depend;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 21&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp;&amp;nbsp; 22&lt;/span&gt; }
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas, courier new"&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;&amp;nbsp; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;Sample&lt;/span&gt; sample
= &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Sample&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;SampleDependency&lt;/span&gt;());
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;b&gt;VFP Version&lt;/b&gt;&lt;pre style="background: #eeeeee"&gt;DEFINE CLASS SampleDependency AS Session 
   FUNCTION SayHello() 
      RETURN "Hello" 
   ENDFUNC 
ENDDEFINE 

DEFINE CLASS Sample AS Session 
   oDepend = NULL 
   FUNCTION Init(toDepend) 
      This.oDepend = toDepend 
   ENDFUNC 
ENDDEFINE 

loSample = CREATEOBJECT("Sample", CREATEOBJECT("SampleDependency"))&lt;/pre&gt;
&lt;pre&gt; 
&lt;/pre&gt;
&lt;p&gt;
Notice that in both cases, we are passing in the instance we want the class to use
instead of letting the class create the instance itself. That's all DI/IoC is. Honest,
that's it. This is DI via a constructor (you can also do it via a property setting
instead; notice in the sample C# code I created a write-only property which could
hold the reference). 
&lt;/p&gt;
&lt;p&gt;
So the next obvious question is, why? What's wrong with just creating the object inside
of the class? 
&lt;/p&gt;
&lt;p&gt;
One thing DI gives you is the ability to easily swap in different objects. In the
C# example, we probably would change the parameter from a specific type to an interface.
Now any class which implements that interface can be injected into this class. In
VFP, since it's not strongly typed, you can just pass in whatever instance you'd like
(it's up to you to make sure it doesn't blow up at runtime by accessing some method
or property which isn't on the passed in object). My initial thought after seeing
this was, well, can't I just use an abstract factory pattern instead? In an abstract
factory you delegate object creation to a "object factory" - usually passing in a
name or calling a method which returns the actual instance you'd like to use. This
sounds like almost the same thing. 
&lt;/p&gt;
&lt;p&gt;
An abstract factory does let you do that, but it doesn't let you easily do something
the DI/IoC pattern does: test your objects. Let's suppose you want to write a test
for a class which uses another class to send out an e-mail. You aren't really trying
to test sending an e-mail - that's just one of the things the class you're testing
happens to do during some process. In fact, you really don't want to send out an e-mail;
we don't want to spam our users. If you happen to use the abstract factory pattern,
you would need to modify it to create your &lt;a href="http://weblogs.asp.net/rosherove/archive/2007/09/16/mocks-and-stubs-the-difference-is-in-the-flow-of-information.aspx" target="_blank"&gt;dummy/stub/mock&lt;/a&gt; object
for sending an e-mail (in VFP that's most likely by editing a record in a table, but
the idea is the same), then test the object in question. If you used the DI/IoC pattern
the only thing you need to do is pass in your dummy/stub/mock object. No other modifications
are necessary. 
&lt;/p&gt;
&lt;p&gt;
OK, so this all looks simple enough. Why would you need a framework for the above?!
One of the biggest reasons - less typing. You'll notice that in order to use any of
these objects you may have to pass in a bunch of other dependency objects (which themselves
may have other dependencies). For a complex set of objects that could really suck.
A DI framework does that for you along with the benefits of an abstract factory, all
rolled up into one. In your code you call the DI framework and tell it to get you
an instance of a class - it figures out what objects need to be passed in for you
so you don't need to do it. In your tests, you can instanciate the objects directly
and pass in your stub/dummy/mock objects instead. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://weblogs.asp.net/rosherove/archive/2007/09/16/mocks-and-stubs-the-difference-is-in-the-flow-of-information.aspx"&gt;http://weblogs.asp.net/rosherove/archive/2007/09/16/mocks-and-stubs-the-difference-is-in-the-flow-of-information.aspx&lt;/a&gt;
&lt;br&gt;
&lt;a title="http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx" href="http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx"&gt;http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=f209f8c4-6087-41cb-b876-ff349f42e8e2" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,f209f8c4-6087-41cb-b876-ff349f42e8e2.aspx</comments>
      <category>.NET</category>
      <category>Software</category>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=ef70ae63-c61a-4f5a-b2d8-12865eba55dd</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,ef70ae63-c61a-4f5a-b2d8-12865eba55dd.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,ef70ae63-c61a-4f5a-b2d8-12865eba55dd.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=ef70ae63-c61a-4f5a-b2d8-12865eba55dd</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Wow, local <a href="http://www.dafug.org/" target="_blank">DAFUG</a>er <a href="http://www.pfsolutions-mi.com/blog" target="_blank">Frank
Perez</a> has actually posted new content on his blog. He's worse than I am with keeping
it updated regularly (and I'm pretty sure only 3 or 4 people even knew he HAD a blog;
that probably keeps the pressure to update it regularly to a minimum). Anyway, he's
showing off a neat <a href="http://www.pfsolutions-mi.com/blog/2008/03/08/BeyondCompare.aspx" target="_blank">plug-in
tool for Beyond Compare</a> that let's you run comparisons against various VFP-specific
filetypes (DBF/MNU/SCX/VCX among others). Check it out.
</p>
        <p>
          <strong>Links:<br /></strong>
          <br />
          <a href="http://www.dafug.org">http://www.dafug.org</a>
          <br />
          <a title="http://www.pfsolutions-mi.com/blog/2008/03/08/BeyondCompare.aspx" href="http://www.pfsolutions-mi.com/blog/2008/03/08/BeyondCompare.aspx">http://www.pfsolutions-mi.com/blog/2008/03/08/BeyondCompare.aspx</a>
        </p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=ef70ae63-c61a-4f5a-b2d8-12865eba55dd" />
      </body>
      <title>Beyond Compare and VFP</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,ef70ae63-c61a-4f5a-b2d8-12865eba55dd.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2008/03/09/BeyondCompareAndVFP.aspx</link>
      <pubDate>Sun, 09 Mar 2008 15:48:44 GMT</pubDate>
      <description>&lt;p&gt;
Wow, local &lt;a href="http://www.dafug.org/" target="_blank"&gt;DAFUG&lt;/a&gt;er &lt;a href="http://www.pfsolutions-mi.com/blog" target="_blank"&gt;Frank
Perez&lt;/a&gt; has actually posted new content on his blog. He's worse than I am with keeping
it updated regularly (and I'm pretty sure only 3 or 4 people even knew he HAD a blog;
that probably keeps the pressure to update it regularly to a minimum). Anyway, he's
showing off a neat &lt;a href="http://www.pfsolutions-mi.com/blog/2008/03/08/BeyondCompare.aspx" target="_blank"&gt;plug-in
tool for Beyond Compare&lt;/a&gt; that let's you run comparisons against various VFP-specific
filetypes (DBF/MNU/SCX/VCX among others). Check it out.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links:&lt;br&gt;
&lt;/strong&gt;
&lt;br&gt;
&lt;a href="http://www.dafug.org"&gt;http://www.dafug.org&lt;/a&gt;
&lt;br&gt;
&lt;a title="http://www.pfsolutions-mi.com/blog/2008/03/08/BeyondCompare.aspx" href="http://www.pfsolutions-mi.com/blog/2008/03/08/BeyondCompare.aspx"&gt;http://www.pfsolutions-mi.com/blog/2008/03/08/BeyondCompare.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=ef70ae63-c61a-4f5a-b2d8-12865eba55dd" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,ef70ae63-c61a-4f5a-b2d8-12865eba55dd.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=99e9e2cb-019b-4a75-a2c8-bdbf96762a15</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,99e9e2cb-019b-4a75-a2c8-bdbf96762a15.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,99e9e2cb-019b-4a75-a2c8-bdbf96762a15.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=99e9e2cb-019b-4a75-a2c8-bdbf96762a15</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
We ran into an interesting performance issue a few weeks back. We had migrated our
primary fileserver over to a new machine (it was previously running on the same machine
as our website). We expected some of the pages on our website to be a bit slower since
the files were no longer on the same box (we have both data in VFP and in SQL Server
2005), but some of them were suddenly painfully slow. They went from 1-2 seconds to
more than 7+ seconds. We talked about installing a dedicated network card to link
two servers to help, but it still didn't seem like the performance should take that
much of a hit. 
</p>
        <p>
My boss spent some time tracing the problem and found it was really slow when we opened
the company file from our accounting system (Sage Pro). I've talked about the <a href="http://www.rcs-solutions.com/blog/2007/10/23/OptimizingVFPCode.aspx" target="_blank">performance
of USE</a> in the past, but it was still amazing to see how slow it was. He tried
using a mapped drive and UNC mapping but the performance of each was about the same.
This particular table is part of a database, so he tried prefixing the USE statement
with the database name, ex. USE F:\PathTo\Data\MyDatabase!MyTable IN 0 - the difference
was amazing. That 7+ seconds dropped back down to 1-2 seconds: a bit slower than it
was when it was local, but still much faster than it had been. Resolving the database
is apparently very slow.
</p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=99e9e2cb-019b-4a75-a2c8-bdbf96762a15" />
      </body>
      <title>Performance of USE</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,99e9e2cb-019b-4a75-a2c8-bdbf96762a15.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2008/03/08/PerformanceOfUSE.aspx</link>
      <pubDate>Sat, 08 Mar 2008 19:16:34 GMT</pubDate>
      <description>&lt;p&gt;
We ran into an interesting performance issue a few weeks back. We had migrated our
primary fileserver over to a new machine (it was previously running on the same machine
as our website). We expected some of the pages on our website to be a bit slower since
the files were no longer on the same box (we have both data in VFP and in SQL Server
2005), but some of them were suddenly painfully slow. They went from 1-2 seconds to
more than 7+ seconds. We talked about installing a dedicated network card to link
two servers to help, but it still didn't seem like the performance should take that
much of a hit. 
&lt;/p&gt;
&lt;p&gt;
My boss spent some time tracing the problem and found it was really slow when we opened
the company file from our accounting system (Sage Pro). I've talked about the &lt;a href="http://www.rcs-solutions.com/blog/2007/10/23/OptimizingVFPCode.aspx" target="_blank"&gt;performance
of USE&lt;/a&gt; in the past, but it was still amazing to see how slow it was. He tried
using a mapped drive and UNC mapping but the performance of each was about the same.
This particular table is part of a database, so he tried prefixing the USE statement
with the database name, ex. USE F:\PathTo\Data\MyDatabase!MyTable IN 0 - the difference
was amazing. That 7+ seconds dropped back down to 1-2 seconds: a bit slower than it
was when it was local, but still much faster than it had been. Resolving the database
is apparently very slow.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=99e9e2cb-019b-4a75-a2c8-bdbf96762a15" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,99e9e2cb-019b-4a75-a2c8-bdbf96762a15.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=b0971da8-51b4-4d4d-8722-7ee556f84a42</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,b0971da8-51b4-4d4d-8722-7ee556f84a42.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,b0971da8-51b4-4d4d-8722-7ee556f84a42.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=b0971da8-51b4-4d4d-8722-7ee556f84a42</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just uploaded a new version of the VFP calendar. I've fixed the problem where the
drop-down version of the calendar wouldn't collapse if you clicked away from it. I
initially thought it would be a simple matter of just adding some code to the calendar
form's LostFocus event. That appeared to work, but had the side effect of breaking
the drop-down button. If the calendar was being displayed and you then tried to click
on the drop-down button to hide the calendar, the LostFocus would fire (hiding the
calendar), then the Click event of the button would fire which would redisplay the
calendar. Not quite what I was expecting.
</p>
        <p>
I experimented with a few different ways of attempting to address this, but I just
couldn't get the events to fire the way I wanted. Ultimately, I ended up adding code
in the Click event to save off the last time since the calendar was hidden. If it
is under the configured minimum interval, we don't do anything (the assumption is
the the LostFocus just fired and hide the calendar). If the interval has been exceeded,
the calendar is displayed as normal. A little weird, but relatively simple to code.
</p>
        <p>
I've also added another sample to show how the rcsDateTimePicker controls can be hooked
together for Start/End date scenarios. The controls keep the start date from being
later than the ending date. The parent (Start) / child (End) relationship is setup
via two properties on the control: uParentPicker and uChildPicker. These properties
are evaluated to resolve to an object reference to the proper control.
</p>
        <p>
 
</p>
        <p>
          <strong>Links</strong>
        </p>
        <p>
          <a href="http://www.rcs-solutions.com/downloads.aspx">http://www.rcs-solutions.com/downloads.aspx</a>
        </p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=b0971da8-51b4-4d4d-8722-7ee556f84a42" />
      </body>
      <title>Another VFP Calendar Update</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,b0971da8-51b4-4d4d-8722-7ee556f84a42.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2008/02/10/AnotherVFPCalendarUpdate.aspx</link>
      <pubDate>Sun, 10 Feb 2008 18:17:16 GMT</pubDate>
      <description>&lt;p&gt;
I just uploaded a new version of the VFP calendar. I've fixed the problem where the
drop-down version of the calendar wouldn't collapse if you clicked away from it. I
initially thought it would be a simple matter of just adding some code to the calendar
form's LostFocus event. That appeared to work, but had the side effect of breaking
the drop-down button. If the calendar was being displayed and you then tried to click
on the drop-down button to hide the calendar, the LostFocus would fire (hiding the
calendar), then the Click event of the button would fire which would redisplay the
calendar. Not quite what I was expecting.
&lt;/p&gt;
&lt;p&gt;
I experimented with a few different ways of attempting to address this, but I just
couldn't get the events to fire the way I wanted. Ultimately, I ended up adding code
in the Click event to save off the last time since the calendar was hidden. If it
is under the configured minimum interval, we don't do anything (the assumption is
the the LostFocus just fired and hide the calendar). If the interval has been exceeded,
the calendar is displayed as normal. A little weird, but relatively simple to code.
&lt;/p&gt;
&lt;p&gt;
I've also added another sample to show how the rcsDateTimePicker controls can be hooked
together for Start/End date scenarios. The controls keep the start date from being
later than the ending date. The parent (Start) / child (End) relationship is setup
via two properties on the control: uParentPicker and uChildPicker. These properties
are evaluated to resolve to an object reference to the proper control.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/downloads.aspx"&gt;http://www.rcs-solutions.com/downloads.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=b0971da8-51b4-4d4d-8722-7ee556f84a42" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,b0971da8-51b4-4d4d-8722-7ee556f84a42.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=e76492e4-5c16-4c00-8288-2dbffee64dec</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,e76492e4-5c16-4c00-8288-2dbffee64dec.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,e76492e4-5c16-4c00-8288-2dbffee64dec.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e76492e4-5c16-4c00-8288-2dbffee64dec</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I'm happy to say my <a href="http://www.rcs-solutions.com/blog/2007/12/13/WinterCleaning.aspx" target="_blank">winter
cleaning</a> give away was a success. Almost all of the books that were available
have new owners (although they may still be waiting for them, since they were shipped
at the book rate which can take forever), and my huge pile of computer equipment is
also gone. I had a taker for the computer equipment within a day of posting it on
my local <a href="http://www.freecycle.org" target="_blank">Freecycle</a> site. I
thought he'd pick through the rubble, but he ended up taking the whole pile (including
my Windows NT 3.51, NT 4.0, and Windows 2000 Resource Kits - those alone took up a
full bookshelf).
</p>
        <p>
There are a few books still available, if anyone is interested. 
</p>
        <p>
          <a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/WinterCleaningPart2_F6FA/Img_4417_4.jpg">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="Img_4417" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/WinterCleaningPart2_F6FA/Img_4417_thumb_1.jpg" width="644" border="0" />
          </a>
        </p>
        <p>
 
</p>
        <p>
          <strong>Links:</strong>
        </p>
        <p>
          <a title="http://www.rcs-solutions.com/blog/2007/12/13/WinterCleaning.aspx" href="http://www.rcs-solutions.com/blog/2007/12/13/WinterCleaning.aspx">http://www.rcs-solutions.com/blog/2007/12/13/WinterCleaning.aspx</a>
          <br />
          <a title="http://www.freecycle.org" href="http://www.freecycle.org">http://www.freecycle.org</a>
        </p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=e76492e4-5c16-4c00-8288-2dbffee64dec" />
      </body>
      <title>Winter Cleaning - Part 2</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,e76492e4-5c16-4c00-8288-2dbffee64dec.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2008/01/13/WinterCleaningPart2.aspx</link>
      <pubDate>Sun, 13 Jan 2008 22:33:56 GMT</pubDate>
      <description>&lt;p&gt;
I'm happy to say my &lt;a href="http://www.rcs-solutions.com/blog/2007/12/13/WinterCleaning.aspx" target="_blank"&gt;winter
cleaning&lt;/a&gt; give away was a success. Almost all of the books that were available
have new owners (although they may still be waiting for them, since they were shipped
at the book rate which can take forever), and my huge pile of computer equipment is
also gone. I had a taker for the computer equipment within a day of posting it on
my local &lt;a href="http://www.freecycle.org" target="_blank"&gt;Freecycle&lt;/a&gt; site. I
thought he'd pick through the rubble, but he ended up taking the whole pile (including
my Windows NT 3.51, NT 4.0, and Windows 2000 Resource Kits - those alone took up a
full bookshelf).
&lt;/p&gt;
&lt;p&gt;
There are a few books still available, if anyone is interested. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/WinterCleaningPart2_F6FA/Img_4417_4.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="Img_4417" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/WinterCleaningPart2_F6FA/Img_4417_thumb_1.jpg" width="644" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a title="http://www.rcs-solutions.com/blog/2007/12/13/WinterCleaning.aspx" href="http://www.rcs-solutions.com/blog/2007/12/13/WinterCleaning.aspx"&gt;http://www.rcs-solutions.com/blog/2007/12/13/WinterCleaning.aspx&lt;/a&gt;
&lt;br&gt;
&lt;a title="http://www.freecycle.org" href="http://www.freecycle.org"&gt;http://www.freecycle.org&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=e76492e4-5c16-4c00-8288-2dbffee64dec" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,e76492e4-5c16-4c00-8288-2dbffee64dec.aspx</comments>
      <category>Other</category>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=48b87fc6-b41a-44ee-8dda-e812dc04affd</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,48b87fc6-b41a-44ee-8dda-e812dc04affd.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,48b87fc6-b41a-44ee-8dda-e812dc04affd.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=48b87fc6-b41a-44ee-8dda-e812dc04affd</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was just reading some of the threads over on the <a href="http://www.universalthread.com" target="_blank">UT</a> and
ran across one where someone was looking for a drop-down calendar control. Someone
suggested they look at the one that I've got in the <a href="http://www.rcs-solutions.com/downloads.aspx" target="_blank">downloads</a> section
on my site. Unfortunately, the version I've had up forever doesn't actually have a
"drop down" version of the control. I've had an updated version for a long time now,
but I've never gotten around to posting it (until now). This thread kicked me in the
butt a little to update this on the site. 
</p>
        <p>
Here's a screenshot of the updated control:
</p>
        <p>
          <a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendar_F335/DropdownCalendar_2.png">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="335" alt="DropdownCalendar" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendar_F335/DropdownCalendar_thumb.png" width="277" border="0" />
          </a>
        </p>
        <p>
Hopefully you find it useful.
</p>
        <p>
          <strong>
          </strong> 
</p>
        <p>
          <strong>Links:</strong>
        </p>
        <p>
          <a href="http://www.universalthread.com">http://www.universalthread.com</a>
          <br />
          <a href="http://www.rcs-solutions.com/Downloads.aspx">http://www.rcs-solutions.com/Downloads.aspx</a>
        </p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=48b87fc6-b41a-44ee-8dda-e812dc04affd" />
      </body>
      <title>Updated VFP Calendar</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,48b87fc6-b41a-44ee-8dda-e812dc04affd.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2008/01/13/UpdatedVFPCalendar.aspx</link>
      <pubDate>Sun, 13 Jan 2008 22:17:45 GMT</pubDate>
      <description>&lt;p&gt;
I was just reading some of the threads over on the &lt;a href="http://www.universalthread.com" target="_blank"&gt;UT&lt;/a&gt; and
ran across one where someone was looking for a drop-down calendar control. Someone
suggested they look at the one that I've got in the &lt;a href="http://www.rcs-solutions.com/downloads.aspx" target="_blank"&gt;downloads&lt;/a&gt; section
on my site. Unfortunately, the version I've had up forever doesn't actually have a
"drop down" version of the control. I've had an updated version for a long time now,
but I've never gotten around to posting it (until now). This thread kicked me in the
butt a little to update this on the site. 
&lt;/p&gt;
&lt;p&gt;
Here's a screenshot of the updated control:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendar_F335/DropdownCalendar_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="335" alt="DropdownCalendar" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/UpdatedVFPCalendar_F335/DropdownCalendar_thumb.png" width="277" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Hopefully you find it useful.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.universalthread.com"&gt;http://www.universalthread.com&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://www.rcs-solutions.com/Downloads.aspx"&gt;http://www.rcs-solutions.com/Downloads.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=48b87fc6-b41a-44ee-8dda-e812dc04affd" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,48b87fc6-b41a-44ee-8dda-e812dc04affd.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=25ee2028-e0c6-47a6-8c07-da492b2213b3</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,25ee2028-e0c6-47a6-8c07-da492b2213b3.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,25ee2028-e0c6-47a6-8c07-da492b2213b3.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=25ee2028-e0c6-47a6-8c07-da492b2213b3</wfw:commentRss>
      <slash:comments>13</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've been spending a lot of time lately doing some winter cleaning. We're trying to
free up some space in the basement for a play area for Brendan. It's amazing how much
stuff you can collect. We've thrown away a LOT of stuff - I'm pretty sure the garbage
guys hate us by now. Jenn mentioned that one of them didn't look too pleased when
he tried to lift one of the bags we put out. We've been donating anything with think
might still be useful, and we have people who drive through our subdivision on garbage
days looking for interesting finds. More power to them, I say; I'd rather someone
finds some use for this stuff instead of throwing it out. Besides, who's got the patience
for a garage sale? And who really wants to deal with people trying to get half price
for an item marked $1 that originally cost $50.
</p>
        <p>
Since I've been involved with computers for quite some time (and not all of it as
a developer), I've managed to collect quite a collection of old computers. Old Pentiums,
486's, a few 386's, motherboards, cases, power supplies, an unbelievable amount of
cables, network cards, video cards, etc. I'm planning on posting that stuff on our
local <a href="http://www.freecycle.org">freecycle</a> site to see if anyone might
be interested in it before tossing it. One of my regrets with a lot of this is that
I didn't give it away sooner, while it still may have been of more use to someone.
I guess that may have been why I kept it.
</p>
        <p>
A big part of this collection is a ton of books and magazines. I've whittled the magazines
down to something manageable, but I still have way too many books. I'm sure I'll add
more to the list as soon as I can convince myself that I really don't need them anymore,
and once I have time to go through the ones still hiding in the basement (and hopefully
before some of them aren't useful anymore). Here's a list of what's on the chopping
block (you might be surprised; there are some good books here):
</p>
        <ul>
          <li>
            <em>Apple II Plus/IIe Troubleshooting &amp; Repair Guide</em>, Robert C. Brenner.
Sams. ISBN: 0-672-22353-8 
</li>
          <li>
            <em>DNS and BIND 3rd Edition</em>, Paul Albitz &amp; Cricket Liu. O'Reilly. ISBN:
1-56592-512-2 
</li>
          <li>
            <strike>
              <em>XML Extensible Markup Language</em> (w/CD), Elliotte Rusty Harold. IDG
Books. ISBN: 0-7645-3199-9 </strike>
          </li>
          <li>
            <strike>
              <em>The Unified Modeling Language User Guide</em>, Booch, Rumbaugh, Jacobson.
Addison-Wesley. ISBN: 0-201-57168-4 </strike>
          </li>
          <li>
            <em>The Visual FoxPro 3 Codebook</em> (CD is missing), Yair Aan Griver. Sybex. ISBN:
0-7821-1648-5 
</li>
          <li>
            <strike>
              <em>Object Orientation in Visual Foxpro</em>, Savannah Brentnall. Addison-Wesley.
ISBN: 0-201-47943-5</strike>
          </li>
          <li>
            <strike>
              <em>Object Models: Strategies, Patterns, &amp; Applications (Second Edition)</em>,
Coad, North, Mayfield. Yourdon Press. ISBN: 0-13-840117-9</strike>
          </li>
          <li>
            <em>Visual Basic 6 Business Objects</em>, Rockford Lhotka. Wrox. ISBN: 1-861001-07-X 
</li>
          <li>
            <strike>
              <em>ASP.NET 2.0 Unleashed</em>, Stephen Walther. Sams. ISBN: 0-672-32823-2</strike>
          </li>
          <li>
            <strike>
              <em>Hacker's Guide to Visual FoxPro 6.0</em>, Granor, Roche. Hentzenwerke
Publishing. ISBN: 0-96550-936-2 </strike>
          </li>
          <li>
            <strike>
              <em>The Inmates Are Running The Asylum</em>, Alan Cooper. Sams. ISBN: 0-672-31649-8 </strike>
          </li>
          <li>
            <strike>
              <em>About Face: The Essentials of User Interface Design</em>, Alan Cooper.
IDG Books. ISBN: 1-56884-322-4 </strike>
          </li>
          <li>
            <strike>
              <em>The Improvement Guide</em>, Langley, Nolan, Nolan, Normal, Provost. Jossey-Bass.
ISBN: 0-7879-0257-8 </strike>
          </li>
          <li>
            <strike>
              <em>HTML: The Complete Reference (Second Edition)</em>, Thomas A. Powell.
Osborne. ISBN: 0-07-211977-2 </strike>
          </li>
          <li>
            <em>Effective Techniques for Application Development w/VFP 6.0</em>, Booth, Sawyer.
Hentzenwerke. ISBN: 0-96550-937-0 
</li>
          <li>
            <strike>
              <em>What's New in Visual FoxPro 8.0</em>, Granor, Hennig. Hentzenwerke. ISBN:
1-930919-40-9 </strike>
          </li>
          <li>
            <strike>
              <em>CrysDev: A Developer's Guide to Integrating Crystal Reports</em>, Craig
Berntson. Hentzenwerke. ISBN: 1-930919-38-7 </strike>
          </li>
          <li>
            <strike>
              <em>Advanced Object Oriented Programming w/VFP 6</em>, Egger.  Hentzenwerke.
ISBN: 0-96550-938-9 </strike>
          </li>
          <li>
            <strike>
              <em>Client/Server Applications w/VFP &amp; SQL Server</em>, Urwiler, DeWitt,
Ley, Koorhan. Hentzenwerke. ISBN: 1-930919-01-8 </strike>
          </li>
          <li>
            <strike>
              <em>C# Unleashed</em>, Joseph Mayo. Sams. ISBN: 0-672-321-22-X</strike>
          </li>
          <li>
            <strike>
              <em>Measuring and Managing Performance in Organizations</em>, Robert D. Austin.
Dorset House. ISBN: 0-932633-36-6</strike>
          </li>
          <li>
            <strike>
              <em>Windows 2000 Server Resource Kit (No CD)</em>, 8 books total<br /></strike> </li>
        </ul>
        <p>
If anyone might be interested in this stuff (books or computer techno-rubble), drop
me a line (I can take a pic. of the computer stuff). All of it free as long as you
pick up the shipping cost. I hope I don't regret giving away some of this, these books
have served me well &lt;g&gt;
</p>
        <p>
 
</p>
        <p>
          <strong>Links:</strong>
        </p>
        <p>
          <a title="http://www.freecycle.org" href="http://www.freecycle.org">http://www.freecycle.org</a>
        </p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=25ee2028-e0c6-47a6-8c07-da492b2213b3" />
      </body>
      <title>Winter Cleaning</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,25ee2028-e0c6-47a6-8c07-da492b2213b3.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2007/12/13/WinterCleaning.aspx</link>
      <pubDate>Thu, 13 Dec 2007 03:23:03 GMT</pubDate>
      <description>&lt;p&gt;
I've been spending a lot of time lately doing some winter cleaning. We're trying to
free up some space in the basement for a play area for Brendan. It's amazing how much
stuff you can collect. We've thrown away a LOT of stuff - I'm pretty sure the garbage
guys hate us by now. Jenn mentioned that one of them didn't look too pleased when
he tried to lift one of the bags we put out. We've been donating anything with think
might still be useful, and we have people who drive through our subdivision on garbage
days looking for interesting finds. More power to them, I say; I'd rather someone
finds some use for this stuff instead of throwing it out. Besides, who's got the patience
for a garage sale? And who really wants to deal with people trying to get half price
for an item marked $1 that originally cost $50.
&lt;/p&gt;
&lt;p&gt;
Since I've been involved with computers for quite some time (and not all of it as
a developer), I've managed to collect quite a collection of old computers. Old Pentiums,
486's, a few 386's, motherboards, cases, power supplies, an unbelievable amount of
cables, network cards, video cards, etc. I'm planning on posting that stuff on our
local &lt;a href="http://www.freecycle.org"&gt;freecycle&lt;/a&gt; site to see if anyone might
be interested in it before tossing it. One of my regrets with a lot of this is that
I didn't give it away sooner, while it still may have been of more use to someone.
I guess that may have been why I kept it.
&lt;/p&gt;
&lt;p&gt;
A big part of this collection is a ton of books and magazines. I've whittled the magazines
down to something manageable, but I still have way too many books. I'm sure I'll add
more to the list as soon as I can convince myself that I really don't need them anymore,
and once I have time to go through the ones still hiding in the basement (and hopefully
before some of them aren't useful anymore). Here's a list of what's on the chopping
block (you might be surprised; there are some good books here):
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Apple II Plus/IIe Troubleshooting &amp;amp; Repair Guide&lt;/em&gt;, Robert C. Brenner.
Sams. ISBN: 0-672-22353-8 
&lt;li&gt;
&lt;em&gt;DNS and BIND 3rd Edition&lt;/em&gt;, Paul Albitz &amp;amp; Cricket Liu. O'Reilly. ISBN:
1-56592-512-2 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;XML Extensible Markup Language&lt;/em&gt; (w/CD), Elliotte Rusty Harold. IDG
Books. ISBN: 0-7645-3199-9 &lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;The Unified Modeling Language User Guide&lt;/em&gt;, Booch, Rumbaugh, Jacobson.
Addison-Wesley. ISBN: 0-201-57168-4 &lt;/strike&gt; 
&lt;li&gt;
&lt;em&gt;The Visual FoxPro 3 Codebook&lt;/em&gt; (CD is missing), Yair Aan Griver. Sybex. ISBN:
0-7821-1648-5 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;Object Orientation in Visual Foxpro&lt;/em&gt;, Savannah Brentnall. Addison-Wesley.
ISBN: 0-201-47943-5&lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;Object Models: Strategies, Patterns, &amp;amp; Applications (Second Edition)&lt;/em&gt;,
Coad, North, Mayfield. Yourdon Press. ISBN: 0-13-840117-9&lt;/strike&gt; 
&lt;li&gt;
&lt;em&gt;Visual Basic 6 Business Objects&lt;/em&gt;, Rockford Lhotka. Wrox. ISBN: 1-861001-07-X 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;ASP.NET 2.0 Unleashed&lt;/em&gt;, Stephen Walther. Sams. ISBN: 0-672-32823-2&lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;Hacker's Guide to Visual FoxPro 6.0&lt;/em&gt;, Granor, Roche. Hentzenwerke
Publishing. ISBN: 0-96550-936-2 &lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;The Inmates Are Running The Asylum&lt;/em&gt;, Alan Cooper. Sams. ISBN: 0-672-31649-8 &lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;About Face: The Essentials of User Interface Design&lt;/em&gt;, Alan Cooper.
IDG Books. ISBN: 1-56884-322-4 &lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;The Improvement Guide&lt;/em&gt;, Langley, Nolan, Nolan, Normal, Provost. Jossey-Bass.
ISBN: 0-7879-0257-8 &lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;HTML: The Complete Reference (Second Edition)&lt;/em&gt;, Thomas A. Powell.
Osborne. ISBN: 0-07-211977-2 &lt;/strike&gt; 
&lt;li&gt;
&lt;em&gt;Effective Techniques for Application Development w/VFP 6.0&lt;/em&gt;, Booth, Sawyer.
Hentzenwerke. ISBN: 0-96550-937-0 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;What's New in Visual FoxPro 8.0&lt;/em&gt;, Granor, Hennig. Hentzenwerke. ISBN:
1-930919-40-9 &lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;CrysDev: A Developer's Guide to Integrating Crystal Reports&lt;/em&gt;, Craig
Berntson. Hentzenwerke. ISBN: 1-930919-38-7 &lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;Advanced Object Oriented Programming w/VFP 6&lt;/em&gt;, Egger.&amp;nbsp; Hentzenwerke.
ISBN: 0-96550-938-9 &lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;Client/Server Applications w/VFP &amp;amp; SQL Server&lt;/em&gt;, Urwiler, DeWitt,
Ley, Koorhan. Hentzenwerke. ISBN: 1-930919-01-8 &lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;C# Unleashed&lt;/em&gt;, Joseph Mayo. Sams. ISBN: 0-672-321-22-X&lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;Measuring and Managing Performance in Organizations&lt;/em&gt;, Robert D. Austin.
Dorset House. ISBN: 0-932633-36-6&lt;/strike&gt; 
&lt;li&gt;
&lt;strike&gt;&lt;em&gt;Windows 2000 Server Resource Kit (No CD)&lt;/em&gt;, 8 books total&lt;br&gt;
&lt;/strike&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
If anyone might be interested in this stuff (books or computer techno-rubble), drop
me a line (I can take a pic. of the computer stuff). All of it free as long as you
pick up the shipping cost. I hope I don't regret giving away some of this, these books
have served me well &amp;lt;g&amp;gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a title="http://www.freecycle.org" href="http://www.freecycle.org"&gt;http://www.freecycle.org&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=25ee2028-e0c6-47a6-8c07-da492b2213b3" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,25ee2028-e0c6-47a6-8c07-da492b2213b3.aspx</comments>
      <category>.NET</category>
      <category>Other</category>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=96f9ec4b-b918-4a0f-ab2b-4c5c58ca990a</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,96f9ec4b-b918-4a0f-ab2b-4c5c58ca990a.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,96f9ec4b-b918-4a0f-ab2b-4c5c58ca990a.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=96f9ec4b-b918-4a0f-ab2b-4c5c58ca990a</wfw:commentRss>
      <slash:comments>29</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
It looks like XSource for VFP 9 SP2 is now up on the Microsoft website: 
</p>
        <p>
          <a href="http://www.microsoft.com/downloads/details.aspx?familyid=320b6438-be76-48c7-a68e-1792e2aa3bf2&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?familyid=320b6438-be76-48c7-a68e-1792e2aa3bf2&amp;displaylang=en</a>
        </p>
        <p>
The interesting thing about this is that it's now licensed under the Microsoft Permission
License so you can now distribute it or your own custom modifications of any of the
tools included in it. This is basically all the source code for things like the DataExplorer,
the Report Builder/Output/Preview controls, the Task Pane, etc.
</p>
        <p>
          <strong>Reporting bug in VFP 9 SP2 </strong>
        </p>
        <p>
Cathy Pountney has an article regarding a new bug introduced into the reporting engine
in SP2 using grouping and group headers. 
</p>
        <p>
          <a href="http://cathypountney.blogspot.com/2007/11/gotcha-serious-report-bug-with-data.html">http://cathypountney.blogspot.com/2007/11/gotcha-serious-report-bug-with-data.html</a>
        </p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=96f9ec4b-b918-4a0f-ab2b-4c5c58ca990a" />
      </body>
      <title>A few VFP links</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,96f9ec4b-b918-4a0f-ab2b-4c5c58ca990a.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2007/11/16/AFewVFPLinks.aspx</link>
      <pubDate>Fri, 16 Nov 2007 02:32:01 GMT</pubDate>
      <description>&lt;p&gt;
It looks like XSource for VFP 9 SP2 is now up on the Microsoft website: 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=320b6438-be76-48c7-a68e-1792e2aa3bf2&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=320b6438-be76-48c7-a68e-1792e2aa3bf2&amp;amp;displaylang=en&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
The interesting thing about this is that it's now licensed under the Microsoft Permission
License so you can now distribute it or your own custom modifications of any of the
tools included in it. This is basically all the source code for things like the DataExplorer,
the Report Builder/Output/Preview controls, the Task Pane, etc.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Reporting bug in VFP 9 SP2 &lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Cathy Pountney has an article regarding a new bug introduced into the reporting engine
in SP2 using grouping and group headers. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://cathypountney.blogspot.com/2007/11/gotcha-serious-report-bug-with-data.html"&gt;http://cathypountney.blogspot.com/2007/11/gotcha-serious-report-bug-with-data.html&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=96f9ec4b-b918-4a0f-ab2b-4c5c58ca990a" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,96f9ec4b-b918-4a0f-ab2b-4c5c58ca990a.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=39cc186c-acec-4fc9-93a8-38922193489c</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,39cc186c-acec-4fc9-93a8-38922193489c.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,39cc186c-acec-4fc9-93a8-38922193489c.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=39cc186c-acec-4fc9-93a8-38922193489c</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
One thing I've learned while using SQL Server is (whenever possible), perform as much
as you can on the server. That means either stored procedures or SQL commands passed
up to the server. It also means thinking about problems as sets, as opposed to a more
procedural approach. Visual FoxPro makes it easy to blur the lines between SQL commands
and normal procedural code (mixing and matching as you'd like), so you tend to start
getting locked into thinking about data on those terms. While some of this translates
directly to SQL Server (obviously, the SQL language itself), other things don't. 
</p>
        <p>
I recently decided to add a new foreign key to a table; the structural specifics aren't
particularly important so I won't go into too much detail about them. Essentially,
I had a parent (A) and child table (B). There is a posting process which takes a snapshot
(C) of some or all of the records in the child table for a specific parent. This snapshot
includes a foreign key back to the original child record but didn't include a foreign
key back to the parent (since it could be derived by joining to this child table).
I began to realize that, because of the number of records involved (it could be as
many as 250,000 records in the child (B) for a single parent record (A), which meant
up to 250,000 records in our snapshot table) that most of the queries were really
slow because of the extra hop involved in resolving this parent key. So, I decided
to go ahead and add a foreign key into the snapshot table (C) to the parent (A). That
also meant I needed to go back and fill in the new foreign key in the Snapshot (C)
table.
</p>
        <p>
 
</p>
        <p>
          <a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/AddingaNewForeignKey_12BA1/Table_2.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="70" alt="Table" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/AddingaNewForeignKey_12BA1/Table_thumb.png" width="471" border="0" />
          </a>
        </p>
        <p>
 
</p>
        <p>
In VFP, you might just open the tables, SCAN through the Snapshot (C) table, do a
SEEK into the Child (B) table for the foreign key back to the Parent (A) table and
save it into the Snapshot (C) table. That works OK if the tables are local, what about
with SQL Server? I guess you could take the same approach; pull a copy of the records
from the Snapshot (C) and Child (B) tables locally, index them, then run through the
same SCAN loop (or if you're really old school, set a relation and just do a REPLACE).
But how long will that take - remember we're talking about pulling down up to 250,000
records in the Child (B) table, plus another 250,000 records from the Snapshot (C)
table, then updating all of the records in Snapshot (C) table. Multiply that by the
number of master records (in my case, only 20-30 of the master records had anywhere
near 250,000 records but we're still talking millions of records).
</p>
        <p>
Suddenly the above approach doesn't look like such a good idea. Thankfully, SQL includes
provisions in the UPDATE command to do exactly what I wanted to. It would still take
a while to run (I clocked it around 25 minutes), but it was a significantly better
solution than a SCAN loop. Here's what the query ends up looking like:
</p>
        <p>
          <font face="Courier New">UPDATE Snapshot<br />
   SET Snapshot.fk_Parent = Child.fk_Parent<br />
  FROM Child<br />
INNER JOIN Snapshot<br />
    ON Snapshot.fk_Child = Child.PrimaryKey</font>
        </p>
        <p>
 
</p>
        <p>
So what does this actually mean? We're basically saying, inside of our Snapshot (C)
table set our new foreign key equal to the Parent (A) foreign key in the Child (B)
table. The FROM/INNER JOIN defines how to match the record in the Snapshot (C) to
the one in Child (B). Simple and fast.
</p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=39cc186c-acec-4fc9-93a8-38922193489c" />
      </body>
      <title>Adding a New Foreign Key</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,39cc186c-acec-4fc9-93a8-38922193489c.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2007/11/03/AddingANewForeignKey.aspx</link>
      <pubDate>Sat, 03 Nov 2007 01:31:41 GMT</pubDate>
      <description>&lt;p&gt;
One thing I've learned while using SQL Server is (whenever possible), perform as much
as you can on the server. That means either stored procedures or SQL commands passed
up to the server. It also means thinking about problems as sets, as opposed to a more
procedural approach. Visual FoxPro makes it easy to blur the lines between SQL commands
and normal procedural code (mixing and matching as you'd like), so you tend to start
getting locked into thinking about data on those terms. While some of this translates
directly to SQL Server (obviously, the SQL language itself), other things don't. 
&lt;/p&gt;
&lt;p&gt;
I recently decided to add a new foreign key to a table; the structural specifics aren't
particularly important so I won't go into too much detail about them. Essentially,
I had a parent (A) and child table (B). There is a posting process which takes a snapshot
(C) of some or all of the records in the child table for a specific parent. This snapshot
includes a foreign key back to the original child record but didn't include a foreign
key back to the parent (since it could be derived by joining to this child table).
I began to realize that, because of the number of records involved (it could be as
many as 250,000 records in the child (B) for a single parent record (A), which meant
up to 250,000 records in our snapshot table) that most of the queries were really
slow because of the extra hop involved in resolving this parent key. So, I decided
to go ahead and add a foreign key into the snapshot table (C) to the parent (A). That
also meant I needed to go back and fill in the new foreign key in the Snapshot (C)
table.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/AddingaNewForeignKey_12BA1/Table_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="70" alt="Table" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/AddingaNewForeignKey_12BA1/Table_thumb.png" width="471" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
In VFP, you might just open the tables, SCAN through the Snapshot (C) table, do a
SEEK into the Child (B) table for the foreign key back to the Parent (A) table and
save it into the Snapshot (C) table. That works OK if the tables are local, what about
with SQL Server? I guess you could take the same approach; pull a copy of the records
from the Snapshot (C) and Child (B) tables locally, index them, then run through the
same SCAN loop (or if you're really old school, set a relation and just do a REPLACE).
But how long will that take - remember we're talking about pulling down up to 250,000
records in the Child (B) table, plus another 250,000 records from the Snapshot (C)
table, then updating all of the records in Snapshot (C) table. Multiply that by the
number of master records (in my case, only 20-30 of the master records had anywhere
near 250,000 records but we're still talking millions of records).
&lt;/p&gt;
&lt;p&gt;
Suddenly the above approach doesn't look like such a good idea. Thankfully, SQL includes
provisions in the UPDATE command to do exactly what I wanted to. It would still take
a while to run (I clocked it around 25 minutes), but it was a significantly better
solution than a SCAN loop. Here's what the query ends up looking like:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;UPDATE Snapshot&lt;br&gt;
&amp;nbsp;&amp;nbsp; SET Snapshot.fk_Parent = Child.fk_Parent&lt;br&gt;
&amp;nbsp; FROM Child&lt;br&gt;
INNER JOIN Snapshot&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ON Snapshot.fk_Child = Child.PrimaryKey&lt;/font&gt; 
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
So what does this actually mean? We're basically saying, inside of our Snapshot (C)
table set our new foreign key equal to the Parent (A) foreign key in the Child (B)
table. The FROM/INNER JOIN defines how to match the record in the Snapshot (C) to
the one in Child (B). Simple and fast.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=39cc186c-acec-4fc9-93a8-38922193489c" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,39cc186c-acec-4fc9-93a8-38922193489c.aspx</comments>
      <category>SQL</category>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=b86be034-5c9d-4213-84df-a87a8fbfa932</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,b86be034-5c9d-4213-84df-a87a8fbfa932.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,b86be034-5c9d-4213-84df-a87a8fbfa932.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=b86be034-5c9d-4213-84df-a87a8fbfa932</wfw:commentRss>
      <slash:comments>18</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
There have been a lot of great sessions done over the years about Intellisense, builders,
etc. (usually by <a href="http://rickschummer.com/blog">Rick Schummer</a> or <a href="http://doughennig.blogspot.com">Doug
Hennig</a>). Every time I've been able to sit in on these sessions, I end up leaving
all geeked up to write some cool routine or code that will make my life easier. A
few days go by and reality sets in - I don't really have the time to actually write
any of that stuff. 6 months go by, someone shows some other slick utility they wrote
and I get all excited about it again. 
</p>
        <p>
With that in mind, here are a few easy changes you can make (that won't take more
than a few minutes) that can help save you some time. Just think how many times a
day you type some of these things:
</p>
        <p>
          <strong>Tools &gt; Intellisense Manager &gt; Custom</strong>
        </p>
        <p>
          <a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/IntellisenseandBuilders_F321/IntellisenseManager_2.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="367" alt="IntellisenseManager" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/IntellisenseandBuilders_F321/IntellisenseManager_thumb.png" width="508" border="0" />
          </a>
        </p>
        <p>
          <strong>CreateObject</strong>
        </p>
        <p>
In the Replace field, enter CO in the With field, enter CREATEOBJECT. Change the Type
combo to Function. Then click Add.
</p>
        <p>
          <strong>MessageBox</strong>
        </p>
        <p>
Now type MB in the Replace field and MESSAGEBOX in the With field, again make sure
the type combo is set to Function.<br /><br />
Now close the Intellisense Manager. At the command window enter:<br /><br /><font face="Courier New">USE (_foxcode) IN 0 AGAIN SHARED<br />
SELECT FoxCode<br />
APPEND BLANK<br />
BROWSE</font></p>
        <p>
          <strong>IF ENDIF</strong>
        </p>
        <p>
In the new record enter:
</p>
        <p>
Type: <font face="Courier New">U</font><br />
Abbrev: <font face="Courier New">IF</font><br />
Cmd: <font face="Courier New">{stmthandler}<br /></font>Data: Double click on it and enter:<br /><font face="Courier New">IF ~<br />
&lt;&lt;lcSpace&gt;&gt;ENDIF</font><br /><br />
Save: T<br />
The timestamp &amp; UniqueID are optional.
</p>
        <p>
          <strong>SCAN ENDSCAN<br /><br /></strong>
          <font face="Courier New">APPEND BLANK</font>
          <br />
          <br />
Type: <font face="Courier New">U</font><br />
Abbrev: <font face="Courier New">SCAN</font><br />
Cmd: <font face="Courier New">{stmthandler}</font><br />
Data: Double click on it and enter:<br /><font face="Courier New">SCAN ~<br />
&lt;&lt;lcSpace&gt;&gt;ENDSCAN</font></p>
        <p>
          <br />
          <strong>FOR ENDFOR</strong>
        </p>
        <font face="Courier New">APPEND BLANK</font>
        <br />
        <br />
Type: <font face="Courier New">U</font><br />
Abbrev: <font face="Courier New">FOR</font><br />
Cmd: <font face="Courier New">{stmthandler}<br /></font>Data: Double click on it and enter:<br /><font face="Courier New">FOR ~<br />
&lt;&lt;lcSpace&gt;&gt;ENDFOR</font><br /><p><br /><strong>WITH<br /></strong><br />
(can you guess?)
</p><p><font face="Courier New">APPEND BLANK</font><br /><br />
Type: <font face="Courier New">U</font><br />
Abbrev: <font face="Courier New">WITH</font><br />
Cmd: <font face="Courier New">{stmthandler}</font><br />
Data: Double click on it and enter:<br /><font face="Courier New">WITH ~<br />
&lt;&lt;lcSpace&gt;&gt;ENDWITH<br /></font><br /><strong>TRY CATCH</strong><br /><br /><font face="Courier New">APPEND BLANK</font></p><p>
Type: <font face="Courier New">U</font><br />
Abbrev: <font face="Courier New">TC</font><br />
Cmd: <font face="Courier New">{stmthandler}</font><br />
Data: Double click on it and enter:<br /><font face="Courier New">TRY<br />
   ~<br />
CATCH TO loEx<br />
ENDTRY</font><br /></p><p><strong>TRY CATCH FINALLY</strong><br /><br /><font face="Courier New">APPEND BLANK</font></p><p>
Type: <font face="Courier New">U</font><br />
Abbrev: <font face="Courier New">TCF</font><br />
Cmd: {stmthandler}<br />
Data: Double click on it and enter:<br /><font face="Courier New">TRY<br />
   ~<br />
CATCH TO loEx<br />
FINALLY<br />
ENDTRY</font></p><p>
Close the browse window and the foxcode table. 
</p><p><strong>Hotkeys:</strong><br /></p><p>
This one will reset the dev. environment for you.<br /><br />
Select Tools &gt; Macros. Click on New. Hit F4 as the key, enter "ClearIt" as the
macro name. Paste this into the macro contents:
</p><p><font face="Courier New">_genscrn=_foxcode{ENTER}<br />
_foxcode{SPACEBAR}={SPACEBAR}""{ENTER}<br />
set{SPACEBAR}development{SPACEBAR}on{ENTER}<br />
execscript("do{SPACEBAR}while{SPACEBAR}txnlevel(0{BACKSPACE})&gt;0"+chr(13)+"rollback"+chr(13)+"enddo"){ENTER}<br />
clear{SPACEBAR}all{ENTER}<br />
release{SPACEBAR}all{ENTER}<br />
clear{SPACEBAR}program{ENTER}<br />
set{SPACEBAR}procedure{SPACEBAR}to{ENTER}<br />
set{SPACEBAR}classlib{SPACEBAR}to{ENTER}<br />
clear{ENTER}<br />
_foxcode=_genscrn{ENTER}</font></p><p>
 
</p><p>
Hit OK.
</p><br />
Now try everything out - open a program window:<br /><br /><font face="Courier New">CO(<br />
MB(</font><br /><br />
Hit the spacebar after these:<br /><br /><font face="Courier New">IF<br />
SCAN<br />
FOR 
<br />
WITH<br />
TC<br />
TCF 
<br /></font><p>
 
</p><p><strong>Links</strong></p><p><a href="http://rickschummer.com/blog">http://rickschummer.com/blog</a><br /><a href="http://doughennig.blogspot.com">http://doughennig.blogspot.com</a></p><img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=b86be034-5c9d-4213-84df-a87a8fbfa932" /></body>
      <title>Intellisense and Builders</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,b86be034-5c9d-4213-84df-a87a8fbfa932.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2007/10/30/IntellisenseAndBuilders.aspx</link>
      <pubDate>Tue, 30 Oct 2007 01:40:50 GMT</pubDate>
      <description>&lt;p&gt;
There have been a lot of great sessions done over the years about Intellisense, builders,
etc. (usually by &lt;a href="http://rickschummer.com/blog"&gt;Rick Schummer&lt;/a&gt; or &lt;a href="http://doughennig.blogspot.com"&gt;Doug
Hennig&lt;/a&gt;). Every time I've been able to sit in on these sessions, I end up leaving
all geeked up to write some cool routine or code that will make my life easier. A
few days go by and reality sets in - I don't really have the time to actually write
any of that stuff. 6 months go by, someone shows some other slick utility they wrote
and I get all excited about it again. 
&lt;/p&gt;
&lt;p&gt;
With that in mind, here are a few easy changes you can make (that won't take more
than a few minutes) that can help save you some time. Just think how many times a
day you type some of these things:
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Tools &amp;gt; Intellisense Manager &amp;gt; Custom&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/IntellisenseandBuilders_F321/IntellisenseManager_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="367" alt="IntellisenseManager" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/IntellisenseandBuilders_F321/IntellisenseManager_thumb.png" width="508" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;CreateObject&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
In the Replace field, enter CO in the With field, enter CREATEOBJECT. Change the Type
combo to Function. Then click Add.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;MessageBox&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Now type MB in the Replace field and MESSAGEBOX in the With field, again make sure
the type combo is set to Function.&lt;br&gt;
&lt;br&gt;
Now close the Intellisense Manager. At the command window enter:&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;USE (_foxcode) IN 0 AGAIN SHARED&lt;br&gt;
SELECT FoxCode&lt;br&gt;
APPEND BLANK&lt;br&gt;
BROWSE&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IF ENDIF&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
In the new record enter:
&lt;/p&gt;
&lt;p&gt;
Type: &lt;font face="Courier New"&gt;U&lt;/font&gt;
&lt;br&gt;
Abbrev: &lt;font face="Courier New"&gt;IF&lt;/font&gt;
&lt;br&gt;
Cmd: &lt;font face="Courier New"&gt;{stmthandler}&lt;br&gt;
&lt;/font&gt;Data: Double click on it and enter:&lt;br&gt;
&lt;font face="Courier New"&gt;IF ~&lt;br&gt;
&amp;lt;&amp;lt;lcSpace&amp;gt;&amp;gt;ENDIF&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
Save: T&lt;br&gt;
The timestamp &amp;amp; UniqueID are optional.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;SCAN ENDSCAN&lt;br&gt;
&lt;br&gt;
&lt;/strong&gt;&lt;font face="Courier New"&gt;APPEND BLANK&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
Type: &lt;font face="Courier New"&gt;U&lt;/font&gt;
&lt;br&gt;
Abbrev: &lt;font face="Courier New"&gt;SCAN&lt;/font&gt;
&lt;br&gt;
Cmd: &lt;font face="Courier New"&gt;{stmthandler}&lt;/font&gt;
&lt;br&gt;
Data: Double click on it and enter:&lt;br&gt;
&lt;font face="Courier New"&gt;SCAN ~&lt;br&gt;
&amp;lt;&amp;lt;lcSpace&amp;gt;&amp;gt;ENDSCAN&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;strong&gt;FOR ENDFOR&lt;/strong&gt;
&lt;/p&gt;
&lt;font face="Courier New"&gt;APPEND BLANK&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
Type: &lt;font face="Courier New"&gt;U&lt;/font&gt;
&lt;br&gt;
Abbrev: &lt;font face="Courier New"&gt;FOR&lt;/font&gt;
&lt;br&gt;
Cmd: &lt;font face="Courier New"&gt;{stmthandler}&lt;br&gt;
&lt;/font&gt;Data: Double click on it and enter:&lt;br&gt;
&lt;font face="Courier New"&gt;FOR ~&lt;br&gt;
&amp;lt;&amp;lt;lcSpace&amp;gt;&amp;gt;ENDFOR&lt;/font&gt;
&lt;br&gt;
&lt;p&gt;
&lt;br&gt;
&lt;strong&gt;WITH&lt;br&gt;
&lt;/strong&gt;
&lt;br&gt;
(can you guess?)
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;APPEND BLANK&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
Type: &lt;font face="Courier New"&gt;U&lt;/font&gt;
&lt;br&gt;
Abbrev: &lt;font face="Courier New"&gt;WITH&lt;/font&gt;
&lt;br&gt;
Cmd: &lt;font face="Courier New"&gt;{stmthandler}&lt;/font&gt;
&lt;br&gt;
Data: Double click on it and enter:&lt;br&gt;
&lt;font face="Courier New"&gt;WITH ~&lt;br&gt;
&amp;lt;&amp;lt;lcSpace&amp;gt;&amp;gt;ENDWITH&lt;br&gt;
&lt;/font&gt;
&lt;br&gt;
&lt;strong&gt;TRY CATCH&lt;/strong&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;APPEND BLANK&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
Type: &lt;font face="Courier New"&gt;U&lt;/font&gt;
&lt;br&gt;
Abbrev: &lt;font face="Courier New"&gt;TC&lt;/font&gt;
&lt;br&gt;
Cmd: &lt;font face="Courier New"&gt;{stmthandler}&lt;/font&gt;
&lt;br&gt;
Data: Double click on it and enter:&lt;br&gt;
&lt;font face="Courier New"&gt;TRY&lt;br&gt;
&amp;nbsp;&amp;nbsp; ~&lt;br&gt;
CATCH TO loEx&lt;br&gt;
ENDTRY&lt;/font&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;TRY CATCH FINALLY&lt;/strong&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;APPEND BLANK&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
Type: &lt;font face="Courier New"&gt;U&lt;/font&gt;
&lt;br&gt;
Abbrev: &lt;font face="Courier New"&gt;TCF&lt;/font&gt;
&lt;br&gt;
Cmd: {stmthandler}&lt;br&gt;
Data: Double click on it and enter:&lt;br&gt;
&lt;font face="Courier New"&gt;TRY&lt;br&gt;
&amp;nbsp;&amp;nbsp; ~&lt;br&gt;
CATCH TO loEx&lt;br&gt;
FINALLY&lt;br&gt;
ENDTRY&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
Close the browse window and the foxcode table. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Hotkeys:&lt;/strong&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
This one will reset the dev. environment for you.&lt;br&gt;
&lt;br&gt;
Select Tools &amp;gt; Macros. Click on New. Hit F4 as the key, enter "ClearIt" as the
macro name. Paste this into the macro contents:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;_genscrn=_foxcode{ENTER}&lt;br&gt;
_foxcode{SPACEBAR}={SPACEBAR}""{ENTER}&lt;br&gt;
set{SPACEBAR}development{SPACEBAR}on{ENTER}&lt;br&gt;
execscript("do{SPACEBAR}while{SPACEBAR}txnlevel(0{BACKSPACE})&amp;gt;0"+chr(13)+"rollback"+chr(13)+"enddo"){ENTER}&lt;br&gt;
clear{SPACEBAR}all{ENTER}&lt;br&gt;
release{SPACEBAR}all{ENTER}&lt;br&gt;
clear{SPACEBAR}program{ENTER}&lt;br&gt;
set{SPACEBAR}procedure{SPACEBAR}to{ENTER}&lt;br&gt;
set{SPACEBAR}classlib{SPACEBAR}to{ENTER}&lt;br&gt;
clear{ENTER}&lt;br&gt;
_foxcode=_genscrn{ENTER}&lt;/font&gt; 
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Hit OK.
&lt;/p&gt;
&lt;br&gt;
Now try everything out - open a program window:&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;CO(&lt;br&gt;
MB(&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
Hit the spacebar after these:&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;IF&lt;br&gt;
SCAN&lt;br&gt;
FOR 
&lt;br&gt;
WITH&lt;br&gt;
TC&lt;br&gt;
TCF 
&lt;br&gt;
&lt;/font&gt; 
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://rickschummer.com/blog"&gt;http://rickschummer.com/blog&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://doughennig.blogspot.com"&gt;http://doughennig.blogspot.com&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=b86be034-5c9d-4213-84df-a87a8fbfa932" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,b86be034-5c9d-4213-84df-a87a8fbfa932.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=cef4b783-f42f-4af4-b382-598833e87a10</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,cef4b783-f42f-4af4-b382-598833e87a10.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,cef4b783-f42f-4af4-b382-598833e87a10.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=cef4b783-f42f-4af4-b382-598833e87a10</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've had these notes about optimizing VFP code hanging around a long time (and added
a few a little more recently). According to the date on it, most of this is from 8/1/2002.
Wow!
</p>
        <p>
Most of this came out of a data conversion project that would take 3-4 hours each
time it was run (and during development we needed to run this a LOT so 3-4 hours would
just kill productivity). 
</p>
        <ul>
          <li>
() evals are much faster than macro substitution:<br /><br /><font face="Courier New">REPLACE (lcField) WITH 1<br /></font><br />
instead of<br /><br /><font face="Courier New">REPLACE &amp;lcField WITH 1<br /></font><br />
2.5 - 3X faster<br /><br />
Directly accessing a field:<br /><br /><font face="Courier New">REPLACE field WITH 1<br /><br /></font>is 8-10X faster than the REPLACE (lcField) WITH 1 code.<br /><br /></li>
          <li>
Do multiple field updates in a single REPLACE.<br /><br />
For example:<br /><br /><font face="Courier New">REPLACE field WITH 1, field2 WITH 2, field3 WITH 3 IN TableName</font><br /><br />
Instead of:<br /><br /><font face="Courier New">REPLACE field1 WITH 1 IN TableName<br />
REPLACE field2 WITH 2 IN TableName<br />
REPLACE field3 WITH 3 IN TableName</font><br /><br /></li>
          <li>
If you are doing COM interop, use WITH/ENDWITH instead of directly accessing object
references - this keeps VFP from having to traverse the object hierarchy on each line.
This can be significantly faster.<br /><br /></li>
          <li>
SCATTER MEMVAR is up to 10X faster than SCATTER NAME, although SCATTER NAME provides
better encapsulation. If you are doing this for a large number of records, SCATTER
MEMVAR may be a much better choice.<br /><br /></li>
          <li>
If you are doing a SELECT ... WHERE IN (SELECT ...) style query, check to see if it's
functionally equivalent to an INNER JOIN. This can make a HUGE difference.<br /><br /></li>
          <li>
CREATEOBJECT() is much faster than NEWOBJECT().<br /><br /></li>
          <li>
Opening and closing tables is one of the slowest thing you can do. In the data conversion
app. we had some code that opened a lookup table at the beginning of the function,
then closed it at the end. The data conversion process was spending approx. 45 minutes
of time in this routine alone. By opening the tables only once (and leaving them open),
the processing time dropped to under 3 minutes (It was so much faster that I had to
test this a few times to make sure I hadn't broken it).</li>
        </ul>
        <p>
 
</p>
        <p>
OK, nothing really earth shattering here. But hopefully you'll find one or two of
the above helpful at some point.
</p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=cef4b783-f42f-4af4-b382-598833e87a10" />
      </body>
      <title>Optimizing VFP Code</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,cef4b783-f42f-4af4-b382-598833e87a10.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2007/10/23/OptimizingVFPCode.aspx</link>
      <pubDate>Tue, 23 Oct 2007 02:23:45 GMT</pubDate>
      <description>&lt;p&gt;
I've had these notes about optimizing VFP code hanging around a long time (and added
a few a little more recently). According to the date on it, most of this is from 8/1/2002.
Wow!
&lt;/p&gt;
&lt;p&gt;
Most of this came out of a data conversion project that would take 3-4 hours each
time it was run (and during development we needed to run this a LOT so 3-4 hours would
just kill productivity). 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
() evals are much faster than macro substitution:&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;REPLACE (lcField) WITH 1&lt;br&gt;
&lt;/font&gt;
&lt;br&gt;
instead of&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;REPLACE &amp;amp;lcField WITH 1&lt;br&gt;
&lt;/font&gt;
&lt;br&gt;
2.5 - 3X faster&lt;br&gt;
&lt;br&gt;
Directly accessing a field:&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;REPLACE field WITH 1&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;is 8-10X faster than the REPLACE (lcField) WITH 1 code.&lt;br&gt;
&lt;br /&gt;
&lt;li&gt;
Do multiple field updates in a single REPLACE.&lt;br&gt;
&lt;br&gt;
For example:&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;REPLACE field WITH 1, field2 WITH 2, field3 WITH 3 IN TableName&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
Instead of:&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;REPLACE field1 WITH 1 IN TableName&lt;br&gt;
REPLACE field2 WITH 2 IN TableName&lt;br&gt;
REPLACE field3 WITH 3 IN TableName&lt;/font&gt;
&lt;br&gt;
&lt;br /&gt;
&lt;li&gt;
If you are doing COM interop, use WITH/ENDWITH instead of directly accessing object
references - this keeps VFP from having to traverse the object hierarchy on each line.
This can be significantly faster.&lt;br&gt;
&lt;br /&gt;
&lt;li&gt;
SCATTER MEMVAR is up to 10X faster than SCATTER NAME, although SCATTER NAME provides
better encapsulation. If you are doing this for a large number of records, SCATTER
MEMVAR may be a much better choice.&lt;br&gt;
&lt;br /&gt;
&lt;li&gt;
If you are doing a SELECT ... WHERE IN (SELECT ...) style query, check to see if it's
functionally equivalent to an INNER JOIN. This can make a HUGE difference.&lt;br&gt;
&lt;br /&gt;
&lt;li&gt;
CREATEOBJECT() is much faster than NEWOBJECT().&lt;br&gt;
&lt;br /&gt;
&lt;li&gt;
Opening and closing tables is one of the slowest thing you can do. In the data conversion
app. we had some code that opened a lookup table at the beginning of the function,
then closed it at the end. The data conversion process was spending approx. 45 minutes
of time in this routine alone. By opening the tables only once (and leaving them open),
the processing time dropped to under 3 minutes (It was so much faster that I had to
test this a few times to make sure I hadn't broken it).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
OK, nothing really earth shattering here. But hopefully you'll find one or two of
the above helpful at some point.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=cef4b783-f42f-4af4-b382-598833e87a10" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,cef4b783-f42f-4af4-b382-598833e87a10.aspx</comments>
      <category>VFP</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=72bcd291-fdf9-47b1-ac58-579ba2cdb96b</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,72bcd291-fdf9-47b1-ac58-579ba2cdb96b.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,72bcd291-fdf9-47b1-ac58-579ba2cdb96b.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=72bcd291-fdf9-47b1-ac58-579ba2cdb96b</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <title>October FoxPro Meeting</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,72bcd291-fdf9-47b1-ac58-579ba2cdb96b.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2007/10/12/OctoberFoxProMeeting.aspx</link>
      <pubDate>Fri, 12 Oct 2007 23:56:57 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font face="Verdana"&gt;We had our monthly FoxPro user group meeting last night, and,
like always, there were some cool new things shown and talked about that I’ve now
got to play with. Cathy Pountney was kind enough to drive over from the Grand Rapids
area to do a session on extending VFP 9’s report writer through extensions and hooking
into the generation process with listeners. She demo’d some code which added a new
print dialog box which allowed the user to pick/configure the printer before printing,
being able to print a document range (ex. 1-10, 11), “Print to Fit” which resizes
a report to fit on 1 page, duplex printing, booklet printing, and being able to print
multiple pages per sheet of paper. Really cool stuff. She’ll be giving this same presentation
at Southwest Fox next week, so if you’re planning on going, don’t miss this session.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Verdana"&gt;One of the “hey, I didn’t know about that command” that came
up was SYS(2600). This command lets you pass in a integer (pointer) and then returns
the memory pointed to by the pointer as a string. It can also write data into the
memory point. This is pretty slick since it allows you to easily interface with win32
API calls that require you to pass in pointers to structures, or use API calls that
return pointers to structures. By setting/getting this memory as a string, you can
then easily parse apart the structure to get the data back.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Verdana"&gt;To be able to do anything useful with this, you’re also going
to need the ability to allocate/de-allocate some memory (and get a pointer to it).
The easiest way to do this is through a few API calls:&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;#&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;DEFINE &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;GMEM_ZEROINIT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
0x40&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp; Init memory contents to zero&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;DECLARE INTEGER &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;GlobalAlloc &lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;IN &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;kernel32.&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;dll &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;;&lt;br&gt;
&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;INTEGER &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;wFlags,
;&lt;br&gt;
&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;INTEGER &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;dwBytes&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;DECLARE INTEGER &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;GlobalFree &lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;IN &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;kernel32.&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;dll &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;;&lt;br&gt;
&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;INTEGER &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;hMem&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;lnPointer = GlobalAlloc(GMEM_ZEROINIT,
110)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;?lnPointer&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;IF &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;lnPointer
&amp;gt; 0&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp; * You
should see a a bunch of squares (nulls)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp; ?&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;SYS&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;(2600,
lnPointer, 110)&lt;br&gt;
&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;SYS&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;(2600,
lnPointer, 100, &lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;REPLICATE&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;("X",
100))&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp; * Now
you should see 100 X's followed by 10 nulls&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp; ?&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;SYS&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;(2600,
lnPointer, 110)&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp; GlobalFree(lnPointer)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;ENDIF&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 9pt; color: blue; font-family: consolas"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Verdana"&gt;A side note: You may see some apps use LocalAlloc/LocalFree instead
of GlobalAlloc/GlobalFree. They are essentially the same thing at this point (that
is, there isn’t any difference between the two of them). This is one of those “backwards
compatibility” things. If you want to know more: &lt;/font&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms810603.aspx"&gt;&lt;font face="Verda"&gt;http://msdn2.microsoft.com/en-us/library/ms810603.aspx&lt;/font&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Verdana" size="2"&gt;There were a couple of other cool utilities/products
that came up as well that I’ll be trying out/writing about.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=72bcd291-fdf9-47b1-ac58-579ba2cdb96b" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,72bcd291-fdf9-47b1-ac58-579ba2cdb96b.aspx</comments>
      <category>VFP</category>
    </item>
  </channel>
</rss>