UncategorizedMarch 9th, 2009Rick Schummer
One of the hallmarks of FoxPro and Visual FoxPro is the level of backwards compatibility the Fox Team was committed to during the decades it was created and enhanced. The compatibility was not just from FoxPro to FoxPro versions, but often was extended to other XBase flavors such as dBASE and Clipper. One of the side-effects of this decision by Fox Software and Microsoft is that developers can easily port code forward, even when there might be easier or better ways to accomplish the same thing.
Over the last week I have helped another developer migrate some Clipper DOS code to Visual FoxPro. The decision to do a direct port of the code was made way before I was asked to help. Because of the deep commitment of the Fox Team this port was working except for three areas where the developer requested my help. The one aspect that caused me the most grief was colors – requirements are to match the colors exactly as the old system.
I figured the color issue would be a snap because the color settings were done through procedures, not on individual @SAY,@GET lines. Each procedure had SET COLOR TO commands. What I did not realize was the color pairings in Clipper were done in numbers instead of letters (apparently Clipper supports both). Visual FoxPro seems to run the code, but the colors were not matching. Took me a while to figure this out,but VFP is more accurate with color pairings as letters. Once I understood this trap I was able to get the colors going in the right direction.
One issue with the colors though was the background color was not set correctly on many of the screens. The @SAY and @GET code displayed correctly. What I learned is that VFP is setting the screen backcolor to the backcolor of the first @SAY done after a CLEAR. Unfortunately that took me a long time to figure out. Once I understood how it works I developed some code that handles it. Oh, and don’t think you can just set _SCREEN.BackColor, it does not work well with @SAY or @GET code.
I guess the Fox Team did not sufficiently test scenarios with @SAY and @GET compatibility (tongue firmly planted in cheek).
Why am I posting this? Is it because I believe many people are running Clipper or FoxBase/FoxPro code in Visual FoxPro these days? No. Just as a reminder to those developers who are faced with the choice of migrating old code to Visual FoxPro and some of the headaches you might face if you select to go the route of running the “compatible” code in Visual FoxPro. The backwards compatibility with old style user interface elements might not be as compatible as you would like. I believe the developer I am working with made the right call for his customer’s situation, and the customer’s requirements and budget, but the cost is going to be many hair pulling moments. Unfortunately in my case I was working with a fixed price budget, and I blew the hours by three times the allotted amount of time. So much for my weekend being fun.
Another lesson re-learned at the school of hard knocks.
UncategorizedFebruary 6th, 2009Rick Schummer
Earlier this week I finished writing the chapter on the Upsizing Wizard for the upcoming Sedna update book we are close to completing. In the chapter review Doug Hennig pointed out a possible third way to run it (the first two being from the VFP Command Window and from the Data Explorer). He suggested trying to rename the Sedna Upsizing Wizard to the name of the old Upsizing Wizard and copying it in the Wizards folder under the VFP root.
This got me thinking. All the Wizards are driven off a table called Wizards.DBF. What if I just added a record in this table and pointed it to the new Sedna version? It works. All part of the extensibility of the Visual FoxPro IDE.
First locate the Upsizing Wizard record in the Wizards table:
USE (HOME() + "WizardsWizard.DBF") ; IN 0 SHARED ALIAS VFPWizard
SELECT VFPWizard
LOCATE FOR Name = "Microsoft SQL Server Upsizing Wizard" ; AND Type = "Upsizing"
Change the Program memo field to:
c:program filesmicrosoft visual foxpro 9sednaupsizingwizardupsizingwizard.app
Or alter the path to your environment setup as needed.
If you want both the original and the Sedna version, just do a SCATTER and GATHER and make the change in the second one. I recommend also changing the Name column because each time you start up the Upsizing Wizard from the menu you will select between the two and the Name column is displayed for you to pick which one you want.
The downloads for the chapter will include a program you can run to correct the registration.
UncategorizedJanuary 22nd, 2009Rick Schummer
As you may know, the April 2008 version of the VFP 9 SP2 Help file is broken. Actually I would consider it a serious mess. Lots of cosmetic things broken, and hyperlinks broken on important things like properties, events, and methods. I blogged about many of the problems found. A real mess, literally unusable, and not much hope from Microsoft to get it fixed by the Help team because of resources.
Several people (who will remain nameless at this time) started working behind the scenes to fix the Help file by decompiling it, repairing the problems, and rebuilding it. Some of us allegedly got closer than others and there allegedly was lots of collaboration, but one person allegedly made a serious breakthrough with lots of time put into getting it corrected.
I contacted Alan Griver and asked if a Help file allegedly was fixed, would Microsoft post it for the Fox Community to use it. You see, there are lots of legal entanglements with copyrights and third-parties and no one wanted anyone to be thrown in jail. It took a while and I was starting to lose hope.
A couple of nights ago Alan emailed me with the news that we can post the changes on VFPX under the Creative Commons license. This means the Fox Community has the rights to improve the VFP 9 SP2 Help file! Some final tweaks are going to be made to the new file, and one additional fix has to be made, but soon a usable VFP 9 SP2 Help file will be posted.
Thanks to Alan Griver for spending time battling Microsoft Legal and going to bat again for the Fox Community. Proof again that even though there might not be an official Fox Team at Microsoft, we still have friends who are helping us out. And thanks to all allegedly involved in the battle to assemble the Help file without some key source files. You know who you allegedly are and you folks rock!
UncategorizedDecember 17th, 2008Rick Schummer
Those following along on Twitter know that I am working with Craig Boyd’s GridExtras class in one of my customer projects. This is an interesting tool that is making me look really proactive to my customers.
One of the features is the ability for users to double-click on the header and the RecordSource is sorted on the column in the grid. Jody Meyer enhanced this to toogle from ascending to descending to no order. The columns can also be filtered which is an awesome feature because Craig mimics the dialogs to work like column filtering in Microsoft Excel. Both of these features put images in the headers of the columns to give the users a visual clue of what is going on for the grid.
For some reason I was not getting the images in my grids. Obviously it is working for Craig because the sample app he ships has the images displayed. It is not a VFP 9 SP2 thing, because I could run his app in VFP 9 SP2 without any issue.
On a whim I moved the images from the gridextras folder I have under a different directory tree on the same drive, and put them into an images folder underneath the project. I then removed all the pointers in the project to the image files and added the images from the new folder into the project. Rebuilt the EXE and presto, the images show up in the grid header. Nice.
My question is why? All the images are compiled into the EXE either way as I did not exclude them in the Project Manager. VFP should be able to find the images in the EXE. Is there a logical answer, or is this one of the VFP quirks I have to remember to work around in the future?
UncategorizedDecember 17th, 2008Rick Schummer
I have a minor in economics and have always found it interesting how economic forces that appear negative for the masses still leave many untouched, and in some cases benefit some who work around and avoid the downturns. Might have to write a white paper some day how I am avoiding the media created recession of 2008. Over the last few months I have been looking for ways to be one of those who avoid the recession. I know, crazy talk if you listen to the so-called experts in the mainstream twisted media. I for one refuse to become a casualty of this economic situation, and so far am winning this battle.
This evening on Twitter I tweeted some of my keys to being successful during these times. I figure that only 10 people will read the tweets, and if I blog about it maybe 10 more might take the time to read.
You will not find sage advice on how to invest or how to survive smaller revenues. I have not had good luck working with investors (bad luck listening to alleged experts, see key #1), and I have no intention to making less money (see key #2). I am once again sharing key strategies of my success, which some people think is nuts (see key #4). Please be advised, your mileage might vary, and take it for what it is worth (free).
- Key numero uno – most pundits are full of themselves and advice should be avoided. Same for elitists and extremists.
- Key numero dos – know how to duck when morons throw shoes at you, and know how to laugh about it afterwards. Translate: avoid negative people.
- Key numero tres – Be willing to take on work no one else wants to touch. Finding a niche funds growth and builds loyalty in customer base.
- Key numero quattro – something learned in Kindergarten: share. Sharing with others helps promote good will that lasts a lifetime, good karma.
- Key numero cinco – positive thoughts, positive results.
- Key numero seis – surround yourself with good, genuine, and smart people.
Sure these are more zen-like than solid things you can add to your to-do list, but that is how I work. Take a view that is higher and visionary and work down. I am sure you can take each one of these keys and build to-do list items that will move you forward. These to-do items will be specific to your situation and environment.
Key #5 has served me well over the years and is one that negative people hate. “It never works” – if you believe this you are correct. I prefer to work the opposite way. These are words I repeat all the time. Hope you enjoyed some initial thoughts on how I am planning to live above the recession experienced by others. I look forward to hearing other ideas too.
UncategorizedDecember 9th, 2008Rick Schummer
Last night one of my clients was implementing their vertical market application half way around the world. The onsite support people were reporting an error when the app was started: “Invalid path or file name.”
Thanks to the new error handler we implemented in the app I tracked this problem down to a single line of code:
CD &lcDataPath;
Looking at the value of lcDataPath it became instantly apparent what the problem was, spaces in the folder name. The tech support person right away explained to me the standard for the install is no spaces in the folder names. This site deviated from the standard folder name recommended by my customer. Now she knows exactly why the original developers proclaimed this “requirement” years ago.
I have not been burned by spaces in code for a long time because I always use indirection in my code whenever I deal with file names or folders.
CD (lcDataPath)
USE (lcFileName) IN 0 SHARED AGAIN
DELETE FILE (lcFileName)
I posted this issue on Twitter earlier today and Andrew MacNeill noted this is probably a great rule to add to Code Analyst up on VFPX. I agree. I am now curious how many developers do not test their applications in folder structures with spaces in the name. I just checked my development machine and all my test folders are space free. But I do install my applications on a virtual machine in the Program Files folders and this tests out the space problem.
Yet one more reason why we have standards at White Light Computing and why the adoption of industry best practices gives us more solid deployments and apps in production. Fortunately the onsite tech people were okay with renaming the folder, otherwise my customer would have been hiring us to review the application for other macro expansion gotchas.
UncategorizedDecember 7th, 2008Rick Schummer
The final day of the conference in Germany is like the final day of any conference, you start out the day exhausted. Add on top of the fact I have not slept more than a couple hours a night because of the jet lag and the time zone difference from home.
I also did not have the first session of the day so I was able to attend Bo Durban’s 8:30 session on “Creating Custom Controls with Sedna.” Yes, another reporting session I am sure will be very useful to me in the near future. Bo showed us how to take the Sedna reporting architecture and extend it for our own purpose. His extensions show how you can drop a shape on the report and have it be one of the custom shapes he has predefined. His custom shape takes on the attributes (size, color, etc.) of the standard VFP shape you drop on the report. Very interesting and will take a little to sink in.
Up next is Tamar’s “Solving Common Problems with VFP SQL” session. It sort of was a session that gave me that time-warp sensation. I recall sitting in on one of Tamar’s SQL sessions at one of the early DevCons (probably 1993 in Orlando). Tamar has been giving SQL sessions for many years so I am not sure if it was then or 1996 in Scottsdale. Or maybe both. It does not matter how many times I see sessions like this, I always walk away being reminded of some technique I have forgotten about. It also reminded me I probably should reread her book: “Taming Visual FoxPro’s SQL – Real World Data Solutions For VFP“. There are techniques I just have not used that were introduced in VFP9 like the ability to create SQL Selects from virtual tables (another SQL Select).
I skipped the Microsoft keynote given by Tim Fischer of Microsoft Deutschland because I probably would only understand about 1% of it. The topic was interesting as it was about Software + Services and VFP, but it was given in German and my mind was not prepared to pseudo translate.
After lunch was “Practical Uses of XML” by Doug. I really liked this session. I definitely have used XML in my customer applications and developer tools, but it is always interesting to see what applications other developers come up with. Doug’s session gave a brief overview of XML and some of the gotchas you have to be aware of and some techniques for working with XML data.
Last session of the conference was my “Extending the Sedna Data Explorer” session. I have done this session numerous times and I got tripped up in the last example where I display the ShowPlans for all the views in a database. The demo crashed and burned. This is a demo I did in the morning when I ran through all my examples one last time. During the day I was working on the Upsizing Wizard chapter and upsized the VFP NorthWind database. I was testing the upsizing of VFP views and when you do this it turns them all into remote views. Well the ShowPlan code is counting on local views and I was seeing the SQL Server login dialog during the demo. Not cool. Fortunately everyone was understanding that the demo gods were not kind during the last 5 minutes of the session. See why I don’t update my machine for a couple weeks before a conference? Even something a silly as a demo can get tripped up by changing data.
Later in the evening of the last day is the speaker dinner. Rainer always comes up with a spectacular spread of interesting food. Each year there is fun discussion and lots of laughs. I thought I would leave by 11:00 but they kicked us out sometime after midnight. I was nearly falling asleep at some point, but got my second wind along the way.
The conference was terrific. I learned a lot, got some important work done, and was able to get some ideas spawned for VFPX during my time in Germany. In fact, during the conference one of the German speakers submitted a project to automate VFP builds. It was accepted and is the first time I was able to tell the project manager face-to-face that the project was accepted. We have not announce the project yet because the project manager is busy with his real job, but expect to see it soon. Looks real interesting. I am looking forward to next year if I am so blessed to be selected to speak in Germany for the fifth straight year.
UncategorizedDecember 7th, 2008Rick Schummer
I skipped all the morning sessions so I could work on my customer projects since I have seen all the English sessions already. I did not get a lot done Wednesday and Thursday and was feeling the heat to produce some code for the deliverables I promised. The code is not very glamorous as it is changes to a FoxPro for DOS app, but the implementation is extremely important for my customer and the code I am working on has some cool elements in scheduling service calls out for the repair people. My customer is changing the process of assigning the calls to the repair people for the first time since the 1990′s so I have to make sure it works and assigns the calls correctly every time.
The first session I attended was Doug’s “Creating Explorer Interfaces in VFP”, a session I have looked forward to since he submitted it as a session for SWFox. His screencast generated a lot of interest among the people who registered for SWFox and it received a lot of praise from people I talked to who went to it (both at SWFox and in Germany). During the session Doug went into something I am coining as “high-speed Canadian” as he started speaking quickly. You can tell when a speaker is really excited by the material they are presenting. Doug is a natural high energy speaker and he was ramping up during the early part of his session. He did slow down eventually. You see, while the Germans are terrific at English, it is not their first language so it is the responsibility of English speakers to conscientiously slow themselves down. The session did not disappoint. Doug has a really powerful treeview wrapper class with all the bells and whistles you could want. I also know he added the ability to disable the treeview after his session based on feedback he got during the session. He also showed how he uses VFPX components from the Themed Controls project as well.
The second part of my “Using VFPX Components in Production Apps” session was next. I presented a couple of components and filled in the rest of the session by showing off the new changes to the New Property/Method and the Edit Property/Method Editor being worked on by Jim Nelson and Doug Hennig, and the recent FoxTabs project lead by Joel Leach.
The last regular session of the day was Kevin McNeish’s “Rich Internet Applications in Silverlight 2.0.” There has been some buzz around Silverlight and I have a potential project that might be best done as a Web app so I wanted to get the scoop on Silverlight.
Rainer asked me to talk about VFPX in the second bonus session during his segment on the future of Visual FoxPro. He wanted me to briefly discuss the importance of VFPX, why it is so important to the future of VFP. I took the opportunity to ask people to get involved one more time.