Archive

Posts Tagged ‘VFP’

Mar
01

I am sure anyone who reads my blog looking for VFP advice and insight already reads Craig Boyd’s blog, but since this is an important discovery and set of instructions I thought I would mention it here.

Last week a friend asked me about installing the Sedna component DDEX for VFP in Visual Studio so he could work with VFP data in Visual Studio.NET. These instructions are a byproduct of the initial inquiry.

Check out Craig’s detailed research and corrections/enhancements to this component here.

Thanks Craig, once again your contributions to our community are huge! I love his statement at the end of his post, and maybe will become our new mantra: “That’s one of the things I love about VFP… the VFP Community can provide for themselves.”

, , ,

Feb
22

Christof Wollenhaupt presented a marathon session this evening at the Detroit Area Fox User Group, and what a session it was. For those who saw Christof present this session at Southwest Fox and/or German DevCon, you saw a terrific session. But DAFUG listened to Christof discuss some really interesting observations he has made with respect to the behavior of VFP for more than three hours – a true director’s cut.

Christof started the session and told us (maybe warned us {g}) we are in a democracy he will talk until 50% of the people in the room left. He ended by running out of material to cover. Only one person left. I think he would have gone on to a second session, but the group was getting hungry for dinner and it was 9:30.

I personally learned numerous things and I saw part of his session in Mesa. One particular aspect was the discussion on memory, variables, and garbage collection. Christof discussed how VFP uses the idle loop to take time to purge unused memory variables. This loop is entered when VFP is waiting (READ EVENTS, INKEY(), a WAIT WINDOW, or even while tracing code in the debugger). Christof also noted something important to me in particular when he pointed out the SYS(1104) function (documented since VFP 7.0 and in the product since FoxPro 2.6) gives the developer a way to initiate garbage collection. I think this is perfect for a project I am working on where I am converting data and one of the routines is taking 11-12 hours scanning through records. The loop gets slower the more records it processes. Using the SYS(1104) function may improve performance.

Thanks Christof for taking time out of your vacation to stop in Detroit and give us a real treat! This was a terrific session! I can’t wait to hear your session proposals for Southwest Fox 2008.

, , ,

Feb
14

Looks like Igor has announced the Prague DevCon for July 1-3, 2008. I can’t say from personal experience, but from talking to others who have attended this conference, it is terrific. This is the conference that hits the big numbers with respect to FoxPro developers every year.

You can get all the details in April, but definitely add this to your calendar if you are near the Czech Republic, and seriously consider attending even if you live half a world away. You will not be disappointed.

, ,

Feb
08

I see wOOdy (aka Juergen Wondzinski, German VFP MVP and guru) has started a code repository for his own FoxPro code. Check it out here: http://code.msdn.microsoft.com/FoxPro

I have subscribed to the RSS feed. Thanks for this resource wOOdy!

Jan
27

Looks like Craig Boyd was up all night putting the Sedna source into VFPX on CodePlex. You can read more at the Sedna page on VFPX. Craig also reveals the location for the very cool DBi Technologies ActiveX controls released with Sedna too!

Thanks Craig!

,

Jan
26

Over on ProFox there has been some minor grumbling about Sedna requiring SP2. I do not think SP2 is required. I can see some of the components requiring VFP 9, but my guess is the components will work fine with SP1 and maybe even the RTM version.

I think the only things required is the .NET 2.0 framework for the NET4COM, Visual Studio for DDEX, SQL Server for the Upsizing Wizard, and Vista for the VistaDialogs. I believe the SP2 requirement on the Web site is one of those things where Microsoft puts the latest version up because it is what they support.

If you think about it, Microsoft did not enhance the core VFP 9 EXE other than to fix bugs (and put some new ones in {g}). Even the new Reporting enhancements in SP2 work in SP1 (something I heard from Colin Nichols at OzFox 2007 if I remember correctly).

The one thing I have not tested is attempting the Sedna install on a machine without SP2. I would be very surprised if the installer checked to see if you have SP2 installed first. If we find out this is the case, I have a workaround to have both SP1 and SP2 on the same machine peacefully.

, ,

Jan
26

I know this has been long in coming, but very early this morning (1:00am EST) Microsoft released the much anticipated Sedna add-ons for Visual FoxPro 9.

You can download it from the Microsoft download site. There is a readme file and an MSI file to download.

Sedna includes the DataExplorer updates, DDEX for .NET access to VFP data, the MY IntelliSense extensions, the NET4COM examples to bridge VFP and .NET, the Upsizing Wizard for SQL Server, and VistaDialogs4COM to modernize VFP on Vista.

I will be installing it soon and will post my thoughts a little later.

, ,

Jan
03

Each time a new version of VFP is released I look at all the new commands and functions to see how I might be able to incorporate them into my user applications and developer tools. Each time I have found some function or command that makes me scratch my head and wonder what the Fox Team had in mind. For VFP 9 this was MAKETRANSACTABLE().

At least this is how I felt about this command up to a month ago. I received a new mini-project from one of my clients who needed a basic import of some accounting data from an external program into their custom app. The external table was a free table created and/or updated by another program. The new records needed to be imported into another DBF contained in a database container. Once the records are imported I needed to stamp them as imported in the free table. Hmmm, sounds like something I would want to do inside a transaction, but I have this free table… ah, finally the perfect reason to use MAKETRANSACTABLE().

The funny thing about this is I have never tried the new command to see if it works {g}. It is rare for me to work with free tables in a production environment. Normally I work with SQL Server, or VFP contained tables.

So I tested it out and it does indeed work, and it works well. The odds of the import not working is very, very remote because I am only adding the new records to the database table (no updates of existing records), but I thought the extra security of doing it inside a transaction was worth the extra couple of commands to add to the code.

Here is some of the code so you can understand fundamentally what I did.

TRY  USE (toParameter.cFeedFile) IN 0 EXCLUSIVE ALIAS (toParameter.cFeedFileAlias)  SELECT (toParameter.cFeedFileAlias)  INDEX ON TimPe TAG TimPe   * Allow the free table to work in a transaction

  MAKETRANSACTABLE(toParameter.cFeedFileAlias)

 * Set buffering so entire table gets updated or can be reverted  CURSORSETPROP("Buffering", 5, toParameter.cFeedFileAlias)  **** Open other tables...

CATCH TO loException  toParameter.lOpenedAll = .F.  toParameter.cTableUpdatedFailureMsg = "Failed opening tables - " + ;                                    loException.Message ENDTRY

*** Handle processing of tables...

* Start a transaction so all changes can be backed out.

BEGIN TRANSACTION

toParameter.lDatabaseFileTableUpdatedResult = ;TABLEUPDATE(.T., .F., toParameter.cDataBaseFileAlias)

IF toParameter.lDatabaseFileTableUpdatedResult * Continue on with the feed table update  toParameter.lFeedFileTableUpdatedResult = ;  TABLEUPDATE(.T., .F., toParameter.cFeedFileAlias)   IF toParameter.lFeedFileTableUpdatedResult * All changes committed    END TRANSACTION  ELSE * Record why    AERROR(laError)    toParameter.cTableUpdatedFailureMsg = laError[2]  ENDIFELSE * Record why  AERROR(laError)  toParameter.cTableUpdatedFailureMsg = laError[2]ENDIF 

* Determine the way to finish up.IF toParameter.lDatabaseFileTableUpdatedResult AND ;  toParameter.lFeedFileTableUpdatedResult * All went well and is commitedELSE  * Problems and rollback  ROLLBACK   TABLEREVERT(.T., toParameter.cDataBaseFileAlias)  TABLEREVERT(.T., toParameter.cFeedFileAlias)  toParameter.nRecordsInserted = 0 ENDIF

RETURN

I think it is cool when there are others that have a vision to incorporate things into Visual FoxPro that hit me years later how I can use them.

,