GRAFUG Meeting February 13, 2010

Thanks to everyone who attended the February 13, 2010 GRAFUG meeting. It was another successful meeting of off-the-cuff discussions and presentations that were very valuable.

What We Discussed

Standards:

  • A lot of questions were asked about “standards”. Does your company have them? Do you follow them? Do you agree with them? How rigid or flexible are they? In general, it was agreed that if a company has “standards”, you should follow them. Whether you agree with them or not isn’t necessarily the point. However, we did discuss that the standards should be reasonable. As long as they’re reasonable, you should follow them. For example, the “tab vs spaces” debate can get heated. Each side of the debate has valid points. If your company has standards requiring one or the other, use it! Don’t buck the system!

  • Rick Schummer with White Light Computer has one of the most comprehensive “standards” documents ever created! They are available for free on his website: http://www.whitelightcomputing.com/resourcesdeveloper.htm

  • Frank Dolinar mentioned a best practices document by Art Bergquist. The 27 (or so) Habits of Highly Effective VFP Developers

  • PEM Editor:

  • In August of 2009, Jim Nelson came to GRAFUG and demonstrated a wonderful tool he’s built called the PEM Editor. It’s a replacement for VFP’s Property and Method dialogs as well as the Property Sheet. It’s available on the VFPX project on CodePlex.

  • Since last summer Jim’s been a busy guy and has been adding lots of new features to the utility. Cathy began to show us some of those cool features. For example, in the designer, Cathy dropped some controls on a form, resized the form, and magically the controls resize along with the form’s new size. This is run-time behavior being mimicked in design-time mode. Jim has created a mechanism that fires your custom code whenever a certain property is changed or an event is fired. In the sample Cathy showed, there was custom code tied to the form and the controls which look at the anchor property on the controls and implemented them when the form resized. It was *REALLY* cool!!!

  • Another cool feature of the PEM Editor is that it can copy Properties and Methods from one class to another. Simply open the 1st class, right-click in a combo box on the PEM Editor, and pick the Copy option. Now open the 2nd class, right-click in a combo box on the PEM Editor, and pick the Paste option. A nice dialog pops up showing all the properties and methods from the 1st class. You can check which ones you want to copy and then tell it to copy. The PEM Editor then adds all the selected properties and values to the 2nd class, along with all the code from the selected methods. It even creates the methods in the 2nd class if they don’t exist. Very cool!!!

  • After seeing these new features, the tongues were wagging! Several people hadn’t seen the PEM Editor before and the questions started flying. Cathy did her best to give a basic demonstration of this awesome tool. In all total, we probably spent a good hour or more on the PEM Editor .. but it was well worth it. People were impressed.

  • The PEM Editor can be downloaded for free from the VFPX project on CodePlex. However, that’s not the version Cathy showed. She’s been lucky enough to be privy to the beta of the upcoming version. The new version should be available to everyone soon. However, Jim has been kind enough to give us permission to let our Members have access to the beta version.Because you’re a GRAFUG Member, you’re received a link to PEM Editor 5.07S

  • Cursor Adapters:

  • After discussing the PEM Editor in great detail, Cathy switched gears and gave a general lesson on cursor adapters.

  • The basic concept behind a cursor adapter is that you create this class, set some properties, and use the Cursor Adapter to access data. The data can reside in a variety of backends and doesn’t have to be FoxPro, but the Cursor Adapter always returns a Fox cursor. T he beauty in this concept is that your program doesn’t have to worry about what the backend is. You just tell it to get the data, and based on the properties on the Cursor Adapter, it figures out how to get the data.

  • Cathy showed how she uses Cursor Adapters to build data for reports in her application. She’s created a custom class that builds a Cursor Adapter object, sets some properties, and calls a method to build the SQL Select statement. Once the statement has been built, the Cursor Adapter object’s CursorFill() method is run, which executes the SELECT statement and returns a cursor. This class is subclassed for each cursor needed for a report. It’s much more flexible than using views because she can send in parameters the user has chosen, and then programmatically build the SELECT statement using those parameters. The WHERE clause can be built based on those parameters, JOIN clauses can be added or removed based on those parameters, and even the field list can be altered based on those parameters. Cathy uses TEXTMERGE to build the statement which is much easier than building a large string with quotes and plus signs.

  • We talked a little bit about updating data through Cursor Adapters, but we just talked theory and didn’t really do any of it. Cathy only uses Cursor Adapters for reports so updating data isn’t something she’s done. Rick Schummer has a session he did at Southwest Fox that talks about varies data access methods and he touched on Cursor Adapters. One thing he mentioned is that using them for updating data can be a real problem if you change your data structures. Because the SQL commands are in properties and/or code in the class, it means you can’t use a tool such as Stonefield Database Toolkit to update your data access, like you can with a view. So that’s a big drawback for using them in an update capacity.

  • SWAG

    We had quite a bit of swag (cool stuff .. free stuff .. promotional stuff ..etc) to give away. All our members in attendance got to choose something. Here’s what everyone walked away with:

    February Selections:
    Who What they picked
    Rich Addison FoxPro Mug
    Mike Timpe Mouse
    Mike Potjer Mouse
    Mike Lyzun Mouse
    Jody Meyer Book: Windows 7
    Lisa Martin Book: Windows 7
    Terry Carrick Microsoft Office 2007
    Cathy Pountney Halo 3 for X-Box
    Frank Dolinar FoxPro Mug

    Next Meeting

    Our next meeting takes place on Saturday, March 13, 2010, at 10:00. Chris Woodruff has agreed to join us and give a presentation titled, “Embracing Your Failures”. It’s a cross platform/development language talk which is very soft skill and career oriented. Look for more details on our website soon. It should be very enlightening.

    MVP Chris Woodruff aka “Woody”
    Software Developer, Solution Architect, Blogger, Podcaster, Thinker
    Tel: 616-724-6885 | Web: http://www.chriswoodruff.com
    Visit podcast: http://deepfriedbytes.com






    Lunch

    After the meeting several people usually go to Arnie’s for lunch to continue the great conversations. Plan to join us if you can.

    After the February meeting, several us went to Arnie’s and had lots of fun. After a few people had left, Frank Dolinar gave those of us remaining a little puzzle to solve. I enjoyed the puzzle so much that I’m going to share it with all of you! (Thanks Frank!) Feel free to send Cathy an email to confirm your solution or get the answer.

    IF

    1 + 2 = 3

    2 + 3 = 10

    7 + 2 = 63

    6 + 5 = 66

    8 + 4 = 96

    THEN

    9 + 7 = ?

    As always … if you have any ideas for future meetings, please let us know … especially if you’re volunteering to be the presenter!!

    Cathy Pountney

    GRAFUG Secretary

    www.grafug.com

     

    If you'd like to be removed from our mailing list, or this email did not reach your preferred email address, please let me know.