Skip to main content

Working Between Visual FoxPro 8 and 9

Many developers have production applications running with one version of a runtime yet do development in a later version. This lets daily work take advantage of the newer productivity tools while the final application is still using the older runtime. The challenge here is ensuring you don't use features in the newer version in code that will run in an older version.
 
A great example is using MESSAGEBOX() to show numbers or dates. Recent versions of Visual FoxPro let you do a MESSAGEBOX(5) and it will do the internal translation between the numeric value and the string equivalent. Seemingly a very simple function yet if you get used to using it, and then have to run on an older version of FoxPro that doesn't support it  - you get a invalid type error message.
 
Likewise with VFP 9 and VFP 8 but this time, it's something a little more hidden. VFP 9 allows developers to take advantage of MemberData, the ability to extend the property sheet further with your own goodies. VFP 8 doesn't have this feature. Yet when working with the two versions side by side, it always seems as though you can write in one and then produce in the other. This is almost true.
 
If you specify member data in a class in VFP 9 (and this can be done very easily using the add-ins provided on the Solutions Sample page), you won't be able to edit them in VFP 8. Instead, you'll get errors where VFP can't find the correct memory variables. The solution is to manually open the VCX or SCX file, find the Properties field with the memberdata in it and remove it.
 
At the bottom of the memo field, you'll see a line that says Name = "classname" but everything before it will be square boxes or binary data, just remove everything from the line that says _memberdata = and all the way down. Then you'll be able to open your class again in VFP 8 and earlier versions.
 
Yes, you will lose your Memberdata (like Favorites, and advanced editors, etc) but the value of cross-version compatibility is far greater, in my opinion.
 

Comments

Popular posts from this blog

Blogs and RSS come to Microsoft.com

MS has just introduced their portal and it's pretty comprehensive. Nothing quite like learning that some people use AIM instead of MSN messenger, or that there really may be a need for supporting 4 monitors ( Cyrus Complains ) However, it's really a great sign that MS is serious about supporting the blogging community which seems to have um, exploded in size in the past year. Blogs and RSS come to Microsoft.com

FoxInCloud Stats

FoxInCloud sent this link a while back about their statistics regarding visits to their site: http://foxincloud.com/blog/2017/12/27/VFP-community-lessons-from-foxincloud-site.html What's interesting here is the breakdown of people. Yes, I think it's understandable that the Fox community is getting older. Another factor is the growth of the mobile and web environments taking over development. These environments really do push people towards the newer non-SQL or free SQL/hosted environments but more towards hosted storage options like Amazon and Google. A tool like FoxInCloud that helps MOVE existing applications to the cloud inherently competes with those environments. But FoxInCloud also allows developers to extend their application further by giving them a starting point using Javascript and the basic CSS (such as Bootstrap). If you're not rebuilding your application from scratch, it's certainly a great step forward. FoxPro VFP

5 Great Reasons to attend Virtual FoxFest

What's coming up? Virtual FoxFest is coming up soon (sessions start October 14th). Like last year, the conference is entirely virtual yet includes great breakdown rooms and sessions to add that nice one-on-one feel that you get in person. It's also staggered so you can choose which days you want to attend - October 14th, 20th and 26th. This is great if you can't break away for a consecutive three days. But really, I've gone through the sessions and I see five great sessions that I'm eager to check out. 1. A Decade of Thor (Rick Schummer) Thor has been an extension for Visual FoxPro that many developers swear by, yet many don't know even exists. Visual FoxPro's built-in extensions are great but Jim Nelson's Thor supercharges your IDE. I can't believe it's been ten years - so Rick's session should be able to not just whet your appetite but give you all the reasons you should be using it. 2. VFP C++ compiler.  Last year, we saw DotNetX as well