Playing Catch Up

by Frank Perez April 8, 2008

When I started this blog, it was never my intention to allow so much time between posts. My goal was to try and blog at least once per month. Well, things have not quite worked out the way I envisioned. I always seem to find my self starting to write something, never feeling 100% happy with it, and then abandoning it all together.

I guess blogging is something that does not come easy to me, at least not yet. I think the only way to beat this problem is to just accept whatever comes out and post it. If it sucks, well at least I tried. So without further delay, here are some things that I've been meaning to post.


Filed Under:

FoxRockX Announcement

by Frank Perez April 8, 2008

Last year we let our subscription to FoxTalk lapse for several reasons. For starters, there was the marketing tactics of Eli Journals. Then there was the matter where the archive issues, published before Eli Journals took over, were no longer available on the web site. But most of all, I felt that the content was not what it used to be.

So when I heard that Rainer Becker was starting a new on-line magazine called FoxRockX, I was like "hey that's cool". Then I heard that one of my favorite columns, the KitBox, would be coming back along with the always entertaining Marcia Atkins and Andy Kramek...and I thought "that's awesome". But when I found that a FoxRockX subscription included on-line access to the complete archives of FoxTalk issues...I was sold.

It is going to be so cool to have the old FoxTalk issues available in a searchable format. I don't know how many times I've been able to get a head start on a problem by taking advantage of something in one of those articles. Plus, I can't wait to see the new stuff.

Subscription in America & Asia
Subscriptions in Europe


Filed Under: VFP

Beyond Compare

by Frank Perez March 8, 2008

Beyond Compare is one of my favorite developer utilities. It's a tool for comparing folders, files, and folder like things such as ZIP and CAB files. It can detect differences using several methods, such as the timestamp, size, CRC, attributes, and more.

Once two files are identified as not identical, you can drill down into the contents and see exactly what is different line by line using Beyond Compare's File Viewer.

This feature is cool, however the native file viewer only supports text files such as HTML, TXT, XML, and so on. If you try to compare a binary file, you get something that looks like this.

I checked Beyond Compare's web site and found several plug-ins for viewing other binary files like BMP, GIF, JPG, and MP3. Hmm, not what I was looking for, but could be a handy thing to have in the future.

I looked around a little more and I found some file viewer rules for handling binary files like DOC, XLS, and PDF. Once again, not what I needed, but I would probably need some day.

So I decided to download a few of these and what I found is that the file viewer rules use Beyond Compare's capability to launch an external conversion program before a file is passed to it's native file viewer. For example, the DOC rule uses a Visual Basic Script (VBS) to automate Microsoft Word, open the passed DOC file, and then save a copy of it to a temporary text file. This temporary file is then passed to Beyond Compare's internal File Viewer for the line by line comparison.

Bingo! If Beyond Compare can call an external conversion program, why not write something that converts FoxPro files to plain text files. And thus VFP2TEXT was created.

Here's how it works. I created a file viewer rule in Beyond Compare for all FoxPro related file types (CDX, DBC, DBF, DCT, DCX, FPT, FRT, FRX, FXP, H, LBT, LBX, MNT, MNX, MPR, MPX, PJT, PJX, PRG, QPR, SCT, SCX, VCT, VCX). This rule calls executes VFP2TEXT.EXE passing both the original file name and a temporary file name.

Based on the file type, the VFP2TEXT.EXE program converts the passed file to a text file using one of the following methods:

  • Index (CDX, DCX): retrieve the index tag information only.
  • Table (DBF, DBC, FRX, SCX, etc): use the CURSORTOXML() function to generate an XML file.
  • Text (H, MPR, PRG, etc): no conversion.
  • Visual Class Library (VCX): use the Class Browser View Code feature to generate a PRG file.

If you would like a copy of this application, you can download the latest version from When using it, there are a couple of things to keep in mind:

  • Beyond Compare will execute the conversion program twice, once for the file on the left and once for the file on the right.
  • Be careful about doing a Rules-Based Comparison on a large directory. I prefer to use the Binary Comparison first, and then use a Rules-Based Comparison on the results.

Beyond Compare


Filed Under: VFP | VFP2Text

December 2007 - DAFUG Meeting

by Frank Perez December 14, 2007

Last night Paul Mrozowski did a presentation called "Lucene.NET as a Document Search Engine". He began by explaining that Lucene.NET is an open source indexing and search library written in C#. It is not a traditional application. Instead it is a tool developers can use to index and search documents, such as CHM, DOC, HLP, PDF, RTF, and TXT files.

Paul first demonstrated how easy it is to install Lucene.NET, some of the configuration settings, and how to set it up to run as a background service in Microsoft Windows. Next he showed us a COM wrapper class that he created in order to use Lucene.NET from Visual FoxPro.

The wrapper class could be used to index the source files and perform some pretty complex searches. I liked the way it could include the surrounding portions of text with the search results. For example, if you searched for the phrase "fox" in "Visual FoxPro Rocks", you could include a variable amount of the original characters found before and after the search phrase.

In addition to indexing document files, he also demonstrated how the wrapper class could be used to build your own index entries with meta data. For example, you could index the contents of a memo field and then store the table name and record identification in the meta data. Later, this information could be searched the same as document file.

Although the wrapper class did not have the complete functionality of Lucene.NET, it did fill the most basic needs. He mentioned the idea of either posting the sample code to his web site or better yet making it a VFPX project. All in all, it was a very cool presentation.

Paul Mrozowski


Filed Under: VFP | .NET

Google 411

by Frank Perez December 9, 2007

Earlier this year Google launched a directory assistance service meant to replace the traditional 411. To use the service, simply dial 1-800-GOOG-411 (800-466-4411) from any telephone. You tell the system the city and state, followed by either a business name or category, such as pizza or movies. Once a match is found, you can automatically be connected to the number, get more details such as the address, or receive a SMS with the results. The best part, it's free!

Personally, I don't use telephone based directory assistance much anymore. However there are times when I don't have access to a web browser, and then Google's 411 is an excellent alternative. So, give it a try and if you like it add it to your cell phone's address book. And don't forget the less than tech savvy people in your lives, such as spouses, parents, and your favorite aunt.



Filed Under:

About Frank

Frank lives in West Bloomfield, Michigan with his wife and three children.  When he is not writing code, he enjoys long distance running and riding his motorcycle.

Month List

Tag Cloud