Archive

Archive for the ‘Uncategorized’ Category

Nov
29

I have been working on an application over the last couple of days for a client. I needed to add 20 or so fields to the OrderMaster table of this application. Simple thing to do, right? Not for me.

I use xCase to model data (both for VFP and for SQL Server). I love xCase for many reasons, but it is way better than using the native SQL Server and VFP Database and Table Designers. I added a bunch of fields yesterday and needed to add a couple I missed today. xCase has this wonderful feature which updates the table structures automatically. Today I get an error during the update:

The fields in table ‘OrderMaster’ did not match the entries in the database (Error 1984)

Argh! The “big brother is watching you error” – reference to George Orwell’s famous book titled 1984. Sorry, I digress.

I believe this is the worst possible error you can get when working with VFP data. The solution recommended by the Help file is to use the VALIDATE DATABASE command or to remove and re-add the table to the database. Both of these options should include a disclaimer that says something to the effect of “both these solutions will hose the database worse and cause your hair to turn grey and fall out.”

The better solution is to get out my trusty backups. Unfortunately, this morning I took my 250GB USB drive and the latest copy of the backups burned on DVD to the safety deposit box at the bank. This is my offsite backup scheme. I rotate the USB drive and permanently leave the DVDs in the box. No problem I’ll just go back and bring them home. Too late – banks close at the worst possible times when it comes to being a developer. So now I get to wait until the morning to get the backups and finish up this project.

This would never be happening to me if I was working with SQL Server {s}.

I have emailed the client to let him know I am a victim of Murphy’s Law, and there will be a short delay in getting him a new release. I just hate having to send emails with bad news.

Guess I have some time to push out another ViewEditor v3.6 Release Candidate this evening…..

Nov
25

Interesting statistic I realized this morning looking at the virus scan statistics: my drives have more than a half-million files scanned when it performs a full system scan. 507, 230 to be exact. That is a lot of files.

Nov
22

Just in case you are not on the Southwest Fox distribution list or have not seen postings on a forum, Bob Kocher dropped me a nice pre-Thanksgiving gift by announcing the dates for next year’s Southwest Fox conference. From Bob:

There are still some details to work out so specifics will have to wait a week or so. For now, I am extremely pleased to announce Southwest Fox will return to Tempe, AZ Thursday, October 19, 2006 through Sunday October 22, 2006. We have a great new location this year and we are working on a couple of new and exciting ideas.

I will be there whether I am a presenter or not. Good timing since companies are already planning budgets for 2006. Way to go Bob!

Nov
20

Today I answered the following question for what seems like the thousandth time: Why do objects on my 2.6 screen not show when I run the code in Visual FoxPro 9?

The answer is to shut off Windows XP Themes. You can do this using the form Themes property, or globally using _screen.Themes = .F. OR SYS(2700, 0) in the start up code for the application. This is an issue with the 2.6 READ compatibility mode. It is a known issue and one we do not expect to be corrected any time soon. It is also easy for a developer to fix.

The good news is I sense more and more FoxPro 2.6 developers are looking to move their application to Visual FoxPro. The bad news is this little problem causes developers more headaches. It also shows developers are trying to take advantage of VFP’s backwards compatibility. I just hope they are not expecting this to be a long term solution and they plan on rewriting the application using the full power of VFP OOP, a solid application framework, and best practices we have developed over the last 10 years of developing VFP applications.

Nov
17

As you may have read before, I use AOL IM (AIM) to keep in contact with my kids online. Yesterday AIM was kind enough to automatically add two new “buddies” to my list. It informed me of this by interrupting me with an instant message:

“AIM added a new AIM Bots group to your Buddy List. AOL System Message: Send IMs to moviefone and shoppingbuddy for great holiday flicks and gift ideas. (To remove ‘em, just right-click and delete! Learn More)”

So not only does it pollute my contact list, but it interrupts my day and my train of thought on some client work with a stupid message telling me it has polluted my contact list. Argh! Not only did I get interrupted once, but then I get another couple of support calls from friends and family asking me if these new bots are safe (after years telling them not to load this kind of stuff) and how to get rid of them. Double Argh! If Microsoft did something like this the media would be all over them asking them to remove things customers did not ask for, but AOL gets a pass on this. Unbelieveable.

Nov
15

Mike and Toni have started the F1 Tech Blog. This means two more very knowledgeable VFP people are sharing more with the community. Check it out. The first post discusses the recent AtoutFox conference in France. Welcome to the blogosphere guys!

Nov
15

Last week Mike Potjer reported a problem in HackCX Professional with the logic to decode the TimeStamp column of the VCX he was hacking while using VFP 9. The error reported is:

Error: (11) ‘Function argument value, type, or count is invalid.’ happened in frmhackmain.convert() on line 75

The line of code triggering the error has been working for a very long time. In fact, the code I use to decode the TimeStamp column has been around for more than 10 years with the only tweak being a change to comply with SET STRICTDATE TO 2 and a cleaner implementation to be Y2K compliant. The line of code triggering the error:

lcRetVal = lcRetVal + DTOC(DATE(lnYear, lnMonth, lnDay))

The TimeStamp should have been decoded properly as it was a valid TimeStamp. The values of lnYear, lnMonth, and lnDay were 2004.8074, 12.918774, and 29.0077209 respectively. In VFP 8 the value of lcRetVal was the character equivalent of {^2004/12/29} and in VFP 9 (both RTM and the SP1 Beta) the code errors.

Mike’s bug report was one of the best I have seen. He provided me the steps, the error log HackCX recorded, and a screen shot of the debugger with all the details surrounding the line of code. It literally took me five minutes to reproduce the problem, make the fix, and send Mike the updated version. He tested it with the Class Library he hacked and all is well.

I was initially thinking of reporting this issue to Microsoft as a bug. As I was creating the reproducible steps, noting the observed behavior and discussing the expected results I started thinking about this in more detail. Here is the test code I was going to send to the Fox Team:

?DATE(2005.3232, 12.2323, 19.3232) && fails
?DATE(2005.3232, 12, 19) && Works

?DATE(2005.3232, 12, 19.3232) && Works

?DATE(2005.3232, 12, 31.3232) && Fails

?DATE(2005.3232, 11.99989, 19.988976) && Works, uses integer of parameters

I struggled with the expected results part of the report. I initially wrote down that I wanted the INT() of the parameter passed in. But what if I really calculated a number like 31.9898 as the day of the month. Should it round to the next day? In the context of my TimeStamp converter I want the INT() and this is how I fixed the code. I am not sure how other FoxPro developers would want this to work and thus came to the conclusion that a valid parameter cannot be bigger than a real date. The decimal portion of the month and day could be larger than the valid values. Therefore the error message reported by VFP was dead on and the documentation in the Help file notes valid parameter values (it just does not say how it addresses the decimal part of the parameter so you have to interpret the parameters as literal maximums).

The DATE() behavior has changed and this little tweak in VFP to tighten down the correct behavior of a function could bite you like me, so I thought I would share the story in case you run across this in your development. Thanks again to Mike Potjer for the excellent bug report and making me think a little about how this function is working.

New version of HackCX Professional will be posted this afternoon for existing and future customers to download.

Nov
14

The final day is always the hardest when it comes to conference days. You are already exhausted from two intensive days of sessions. More importantly, there are the evening sessions in the lobby or hotel bar which go late into the night. Last night was no exception. I went back to my room after midnight and ran through my two sessions to ensure the examples were still running (more on that later).

I started out my day listening to Martin Haluza who presented his session called Converting Your Reports. Martin is the lead developer on XFRX. He showed us some cool stuff with the new version of XFRX and demonstrated some of the things he is working on. It was good to finally meet Martin. I really like his product and more importantly my customers really like the functionality of XFRX. Great session.

The next session I split across two sessions. I first attended Christof Wollenhaupt’s German speaking session titled Multithreading in Visual FoxPro. This was a double whammy for me and I knew going in I was going to struggle with the German (maybe the biggest understatement of this blog entry) and the complex topic dealt with .NET and VFP. I just really wanted to see Christof speak. He is someone I respect and is extremely knowledgeable. I have hoped for years that he would be invited to speak in North America. I took the opportunity to see him and I was not let down. Bob from Southwest Fox – take note – invite Christof to speak at the next conference. He was fantastic. I made an observation of Christof’s speaking style and asked one of the German attendees to confirm. Christof was speaking fast. The attendee gave Christof a high compliment and said Christof was speaking fast, and to quote him: “Christof is the Drew Speedie of Germany.”

The other half of the session I sat in on Rick Strahl’s demo of The Next Version of Web Connection. Rick was wowing the crowd. The good news: I understood a little more of what Rick is doing than what Christof was explaining so well. {g}

My Get More Productive with Visual FoxPro session was well attended. Based on a couple of people who talked to me afterwards, the session went pretty well.

After lunch I attended Rick Strahl’s The Making of Help Builder session. Rick showed off several of the new features of version 4.20 and I learned a couple of tricks with graphics and resorting the help topics which will come in handy as I update the HackCX and ViewEditor Help files in the coming weeks.

My Builders Made Easy session is my favorite session to give and was glad Rainer scheduled my best for last. I really like builders and use the builders and property editors I demo during this session all the time. Today I could not get my Apply Naming Conventions property editor to function during the session. Just one of those glitches you get from time to time when you are demoing to 15 of your friends. Thanks to Andy Kramek who reminded me during the session that the Name property cannot be changed by a builder when you are working with a class. It works great for forms and objects contained on forms, but not for the container classes.

The last regular session of the conference I attended was Using the Treeview Control in VFP by Venelina Jordanova. This is the first time I have seen Venelina speak. She took a tough control to work with and demonstrated a number of ways to better work with the TreeView. Maybe Craig Berntson should have attended this session to help him with the Solution Explorer {gd&rvvvf;}. I was surprised when I got to the room and found Venelina speaking English. I thought she was going to be doing the session in German. She did a great job.

The last session of the conference was the closing session. Rainer announced dates for next year (November 9-11, 2006) and gave away several packages donated by the vendors. Always nice to leave a conference on a positive and uplifting note.

This was a great conference. The sessions were terrific, the hospitality second to none, and the people were fun to hang out with. My head is full of new ideas and renewed interest in a couple of topics. Cannot wait to get to work.

At the speaker dinner we were talking about the conference and Steve Black asked me if the conference had met my expectations. I talked to a lot of people before going over to Germany and everyone I talked to about the conference raised my expectations higher and higher. So walking in the door I was expecting a lot. I told Steve my expectations were not only met, but were exceeded. If you are preparing your budgets for next year’s conference for you or your team, definitely give next year’s German DevCon a solid consideration.

(this blog was posted a couple days after it was written because we lost the Internet connectivity when the conference ended and I was not about to pay the hotel 22 Euros for connectivity for a couple of hours because they based the rental fee on a fixed window of time, not a linear 24 hours. Besides, 22 Euros is way to much when most hotels I stay at give it to me for no extra charge.)